Log Message: Improve support for svn_checksum.h in SWIG bindings * subversion/bindings/swig/python/tests/checksum.py: Improved test_checksum
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 = svn.core.svn_checksum_to_cstring_display(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 # 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 Exception ("Value of Initialized digest is not 0") + else: + raise Exception ("Length of Initialized digest does not match kind") else: - self.assertRaises(TypeError, test_checksum) + raise Exception("Type of digest is not str") def suite(): return unittest.defaultTestLoader.loadTestsFromTestCase(ChecksumTestCases) @@ -45,4 +48,3 @@ -