示例#1
0
 def test_throw_exception_for_collisions(self):
     testHash = Hash()
     testHash.put('foo', 'this is a thing')
     with self.assertRaises(Exception):
         testHash.put('foo', 'a new thing')
示例#2
0
 def test_put_method(self):
     testHash = Hash()
     testHash.put('foo', 'this is a thing')
     self.assertTrue(testHash.hashTable[3] == 'this is a thing')
示例#3
0
 def test_get_method(self):
     testHash = Hash()
     testHash.put('foo', 'this is a thing')
     testGet = testHash.get('foo')
     self.assertTrue(testGet == 'this is a thing')