diff options
Diffstat (limited to 'tests/test_checksum.py')
-rw-r--r-- | tests/test_checksum.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/test_checksum.py b/tests/test_checksum.py index 66cd96b..b8f0453 100644 --- a/tests/test_checksum.py +++ b/tests/test_checksum.py @@ -14,27 +14,33 @@ import os import tempfile import unittest +import testcase -from g_octave import checksum +from g_octave import checksum, description_tree -class TestChecksum(unittest.TestCase): +class TestChecksum(testcase.TestCase): def setUp(self): + testcase.TestCase.setUp(self) self._tempfile = tempfile.mkstemp()[1] with open(self._tempfile, 'w') as fp: # SHA1 checksum: 8aa49f56d049193b183cb2918f8fb59e0caf1283 fp.write("I'm the walrus\n") - def test_checksum(self): + def test_filechecksum(self): my_checksum = checksum.sha1_compute(self._tempfile) self.assertEqual(my_checksum, '8aa49f56d049193b183cb2918f8fb59e0caf1283') - self.assertTrue(checksum.sha1_check(self._tempfile, my_checksum)) + + def test_dbchecksum(self): + self.assertTrue(checksum.sha1_check_db(description_tree.DescriptionTree())) def tearDown(self): + testcase.TestCase.tearDown(self) os.unlink(self._tempfile) def suite(): suite = unittest.TestSuite() - suite.addTest(TestChecksum('test_checksum')) + suite.addTest(TestChecksum('test_filechecksum')) + suite.addTest(TestChecksum('test_dbchecksum')) return suite |