import unittest from tudelft.utilities.tools.safehash import safehash class SafeHashTest(unittest.TestCase): def tests(self): lst=[1,2,3] safehash(lst) safehash({'a':1}) safehash( set(lst)) safehash({'a':set(lst)}) h1= safehash({'a':1}) h2= safehash({'a':2}) self.assertNotEqual(h1,h2) h1= safehash({'a':1,'b':2}) h2= safehash({'b':2,'a':1}) self.assertEqual(h1,h2) # you can a set in a set... #safehash(set([set(lst)]))