diff options
author | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2013-09-29 21:24:18 +0200 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2013-09-29 21:24:18 +0200 |
commit | 49e253fd606d47508d1b449325718f855c263d0a (patch) | |
tree | 4cabbe693617e2158e9691a328110276e4b8e7fc /test/test_common.py | |
parent | test_otultra2: factor out setting of returned serial string. (diff) | |
download | glucometerutils-49e253fd606d47508d1b449325718f855c263d0a.tar glucometerutils-49e253fd606d47508d1b449325718f855c263d0a.tar.gz glucometerutils-49e253fd606d47508d1b449325718f855c263d0a.tar.bz2 glucometerutils-49e253fd606d47508d1b449325718f855c263d0a.tar.lz glucometerutils-49e253fd606d47508d1b449325718f855c263d0a.tar.xz glucometerutils-49e253fd606d47508d1b449325718f855c263d0a.tar.zst glucometerutils-49e253fd606d47508d1b449325718f855c263d0a.zip |
Diffstat (limited to '')
-rw-r--r-- | test/test_common.py | 51 |
1 files changed, 23 insertions, 28 deletions
diff --git a/test/test_common.py b/test/test_common.py index 1f6c8da..07b65d9 100644 --- a/test/test_common.py +++ b/test/test_common.py @@ -10,45 +10,40 @@ import os import sys import unittest -import mock - sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from glucometerutils import common from glucometerutils import exceptions class TestCommon(unittest.TestCase): - def setUp(self): - pass - - def test_glucose_conversion(self): - self.assertEqual( - 5.56, common.convert_glucose_unit( - 100, common.UNIT_MGDL, common.UNIT_MMOLL)) + def test_glucose_conversion(self): + self.assertEqual( + 5.56, common.convert_glucose_unit( + 100, common.UNIT_MGDL, common.UNIT_MMOLL)) - self.assertEqual( - 5.56, common.convert_glucose_unit( - 100, common.UNIT_MGDL)) + self.assertEqual( + 5.56, common.convert_glucose_unit( + 100, common.UNIT_MGDL)) - self.assertEqual( - 180, common.convert_glucose_unit( - 10, common.UNIT_MMOLL, common.UNIT_MGDL)) + self.assertEqual( + 180, common.convert_glucose_unit( + 10, common.UNIT_MMOLL, common.UNIT_MGDL)) - self.assertEqual( - 180, common.convert_glucose_unit( - 10, common.UNIT_MMOLL)) + self.assertEqual( + 180, common.convert_glucose_unit( + 10, common.UNIT_MMOLL)) - self.assertEqual( - 100, common.convert_glucose_unit( - 100, common.UNIT_MGDL, common.UNIT_MGDL)) + self.assertEqual( + 100, common.convert_glucose_unit( + 100, common.UNIT_MGDL, common.UNIT_MGDL)) - self.assertEqual( - 10, common.convert_glucose_unit( - 10, common.UNIT_MMOLL, common.UNIT_MMOLL)) + self.assertEqual( + 10, common.convert_glucose_unit( + 10, common.UNIT_MMOLL, common.UNIT_MMOLL)) - self.assertRaises( - exceptions.InvalidGlucoseUnit, - common.convert_glucose_unit, common.UNIT_MMOLL, 'foo') + self.assertRaises( + exceptions.InvalidGlucoseUnit, + common.convert_glucose_unit, common.UNIT_MMOLL, 'foo') if __name__ == '__main__': - unittest.main() + unittest.main() |