Mercurial > treepkg
diff test/test_util.py @ 394:bfd1c6a155fa treepkg-status
added md5sum function
author | Bjoern Ricks <bricks@intevation.de> |
---|---|
date | Fri, 09 Jul 2010 12:42:42 +0000 |
parents | e3ab8aca2b08 |
children | 8e0c81870e5e |
line wrap: on
line diff
--- a/test/test_util.py Fri Jul 09 10:20:49 2010 +0000 +++ b/test/test_util.py Fri Jul 09 12:42:42 2010 +0000 @@ -12,7 +12,7 @@ from filesupport import FileTestMixin -from treepkg.util import replace_in_file, listdir_abs +from treepkg.util import replace_in_file, listdir_abs, md5sum class TestReplaceInFile(unittest.TestCase, FileTestMixin): @@ -72,3 +72,13 @@ self.assertEquals(sorted(listdir_abs(directory, '*.dsc')), [os.path.join(directory, "foo.dsc")]) +class TestMd5sum(unittest.TestCase, FileTestMixin): + + content = "this is a test content" + + def setUp(self): + self.testfile = self.create_temp_file("testmd5.txt", self.content) + + def test_md5sum(self): + sum = md5sum(self.testfile) + self.assertEquals("a12511153555c1f0f0a1eda200733a3f", sum)