Log Message: Improve support for svn_checksum.h in SWIG bindings * subversion/bindings/swig/python/tests/checksum.py: Improved test_checksum
Review by: danielsh Modified: subversion/trunk/subversion/bindings/swig/python/tests/checksum.py Regards, Shivani Poddar Bachelors in Computer Sciences and MS in Exact Humanities, Sophomore International Institute of Information Technology, Hyderabad
Index: subversion/bindings/swig/python/tests/checksum.py =================================================================== --- subversion/bindings/swig/python/tests/checksum.py (revision 1419694) +++ subversion/bindings/swig/python/tests/checksum.py (working copy) @@ -20,22 +20,25 @@ # import unittest, setup_path import svn.core - +LENGTH = 32 or 40; class ChecksumTestCases(unittest.TestCase): def test_checksum(self): # Checking primarily the return type for the svn_checksum_create # function val = svn.core.svn_checksum_create(svn.core.svn_checksum_md5) check_val = svn.core.svn_checksum_to_cstring_display(val) - # The svn_checksum_to_cstring_display should return a str type object # from the check_val object passed to it if(type(check_val) == str): - # The intialized value created from a checksum should be 0 - if(int(check_val) != 0): - self.assertRaises(AssertionError) + #Check the length of the string check_val + if(len(check_val) == LENGTH): + # The intialized value created from a checksum should be 0 + if(int(check_val) != 0): + raise + else: + raise else: - self.assertRaises(TypeError, test_checksum) + raise def suite(): return unittest.defaultTestLoader.loadTestsFromTestCase(ChecksumTestCases)