source: utilitiespy/test/tools/safehashtest.py@ 1057

Last change on this file since 1057 was 1057, checked in by wouter, 5 months ago

#354 hashcode fixes.Apparently a Dict is a Collection in python

File size: 373 bytes
Line 
1import unittest
2from tudelft.utilities.tools.safehash import safehash
3
4class SafeHashTest(unittest.TestCase):
5
6 def tests(self):
7 lst=[1,2,3]
8 safehash(lst)
9 safehash({'a':1})
10 safehash( set(lst))
11 safehash({'a':set(lst)})
12
13 h1= safehash({'a':1})
14 h2= safehash({'a':2})
15 self.assertNotEqual(h1,h2)
16 # you can a set in a set...
17 #safehash(set([set(lst)]))
18
19
Note: See TracBrowser for help on using the repository browser.