Exemplo n.º 1
0
    def testRemove(self):
        table = ChainedHashTable(3)
        table.insert(0)
        table.insert(5)
        table.insert(2)

        self.assertEquals(table.remove(5), 5)
        self.assertEquals(table.remove(4), None)
        self.assertEquals(table.buckets[0], [0])
        self.assertEquals(table.buckets[1], [])
        self.assertEquals(table.buckets[2], [2])