Skip to content

Commit

Permalink
test_get_dt first draft
Browse files Browse the repository at this point in the history
  • Loading branch information
kosovan committed May 17, 2024
1 parent fd0c4b4 commit 0df2219
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ unit_tests:
${PYTHON} testsuite/read-write-df_test.py
${PYTHON} testsuite/parameter_test.py
${PYTHON} testsuite/henderson_hasselbalch_tests.py
${PYTHON} testsuite/analysis_tests.py

functional_tests:
${PYTHON} testsuite/cph_ideal_tests.py
Expand Down
19 changes: 19 additions & 0 deletions testsuite/analysis_tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import io
import json
import contextlib
import unittest as ut
import numpy as np
import pandas as pd
import pyMBE
import lib.analysis as ana


class Serialization(ut.TestCase):

def test_get_dt(self):
data = pd.DataFrame.from_dict( {'time': [0, 1, 2,], 'obs': ['1.0', '2.0', '4.0']} )
dt = ana.get_dt(data)
self.assertAlmostEqual(dt, 1.0, delta = 1e-7)

if __name__ == "__main__":
ut.main()

0 comments on commit 0df2219

Please sign in to comment.