diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2010-12-09 23:22:27 -0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2010-12-09 23:22:27 -0200 |
commit | d0c6e156e471287ae0aa33150b01bba60362db57 (patch) | |
tree | b53b7b8b9e58412356ab6b954010e912afb1c497 /tests/test_checksum.py | |
parent | small fixes on the log class and some minor typos (diff) | |
download | g-octave-d0c6e156e471287ae0aa33150b01bba60362db57.tar.gz g-octave-d0c6e156e471287ae0aa33150b01bba60362db57.tar.bz2 g-octave-d0c6e156e471287ae0aa33150b01bba60362db57.zip |
fixed a bunch of tests
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 |