From 21723b0d0b97a71aad8aafeb5d413015b2909320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Thu, 28 Dec 2017 12:23:54 +0000 Subject: accucheck_reports: fix bug for mg/dL native meters. This was mixing up the units in the conversion. While fixing the bug, remove the confusing two-parameter form of convert_glucose_unit. --- test/test_common.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'test/test_common.py') diff --git a/test/test_common.py b/test/test_common.py index febf578..8ca50e1 100644 --- a/test/test_common.py +++ b/test/test_common.py @@ -21,18 +21,10 @@ class TestCommon(unittest.TestCase): 5.56, common.convert_glucose_unit( 100, common.Unit.MG_DL, common.Unit.MMOL_L)) - self.assertEqual( - 5.56, common.convert_glucose_unit( - 100, common.Unit.MG_DL)) - self.assertEqual( 180, common.convert_glucose_unit( 10, common.Unit.MMOL_L, common.Unit.MG_DL)) - self.assertEqual( - 180, common.convert_glucose_unit( - 10, common.Unit.MMOL_L)) - self.assertEqual( 100, common.convert_glucose_unit( 100, common.Unit.MG_DL, common.Unit.MG_DL)) @@ -42,8 +34,8 @@ class TestCommon(unittest.TestCase): 10, common.Unit.MMOL_L, common.Unit.MMOL_L)) self.assertRaises( - exceptions.InvalidGlucoseUnit, - common.convert_glucose_unit, common.Unit.MMOL_L, 'foo') + ValueError, + common.convert_glucose_unit, 10, common.Unit.MMOL_L, 'foo') if __name__ == '__main__': unittest.main() -- cgit v1.2.3