Index: subversion/bindings/swig/python/tests/checksum.py =================================================================== --- subversion/bindings/swig/python/tests/checksum.py (revision 1446877) +++ subversion/bindings/swig/python/tests/checksum.py (working copy) @@ -18,9 +18,10 @@ # under the License. # # +import sys import unittest, setup_path import svn.core - +LENGTH = svn.core.svn_checksum_size(svn.core.svn_checksum_create(svn.core.svn_checksum_md5)) class ChecksumTestCases(unittest.TestCase): def test_checksum(self): # Checking primarily the return type for the svn_checksum_create @@ -28,7 +29,12 @@ class ChecksumTestCases(unittest.TestCase): kind, expected_length = svn.core.svn_checksum_md5, 128/8 val = svn.core.svn_checksum_create(kind) check_val = svn.core.svn_checksum_to_cstring_display(val) + is_duplicate = svn.core.svn_checksum_dup(val); + self.assertEqual(type(check_val),str,"Type of digest not string") + self.assertEqual(len(check_val)%LENGTH,0,"Length of digest does not match kind") + self.assertEqual(int(check_val),0,"Value of initialized digest is not 0") + self.assertTrue(isinstance(check_val, str), "Type of digest not string") self.assertEqual(len(check_val), 2*expected_length, @@ -36,6 +42,8 @@ class ChecksumTestCases(unittest.TestCase): self.assertEqual(int(check_val), 0, "Value of initialized digest is not 0") + self.assertTrue(type(val) is type(is_duplicate), + "Type of return value not svn_checksum_t*") def suite(): return unittest.defaultTestLoader.loadTestsFromTestCase(ChecksumTestCases) @@ -45,4 +53,3 @@ if __name__ == '__main__': -