diff --git a/Makefile b/Makefile index 9a148de..12a9397 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/testsuite/analysis_tests.py b/testsuite/analysis_tests.py new file mode 100644 index 0000000..f8c7fdf --- /dev/null +++ b/testsuite/analysis_tests.py @@ -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()