Example #1
0
 def test_avl_tree_dict_update(self):
     d1 = AvlTreeDict()
     d1[1] = 1
     d2 = AvlTreeDict()
     d2[2] = 2
     d1.update(d2)
     self.assertEquals(d1, {1: 1, 2: 2})
Example #2
0
 def test_avl_tree_dict_setitem3(self):
     d = AvlTreeDict()
     d[10] = 1
     d[6] = 1
     d[3] = 1
     d[34] = 1
     d[213] = 1
     d[23] = 1
     d[12] = 2
     self.assertEquals(d[6], 1)
Example #3
0
 def test_avl_tree_dict_values(self):
     d = AvlTreeDict()
     d[1] = 2
     self.assertEquals(d.values(), [2])
Example #4
0
 def test_avl_tree_dict_popitem(self):
     d = AvlTreeDict()
     d[1] = 2
     self.assertEquals(d.popitem(1), (1, 2))
Example #5
0
 def test_avl_tree_dict_pop(self):
     d = AvlTreeDict()
     d[1] = 2
     d.pop(1)
     self.assertEquals(len(d), 0)
Example #6
0
 def test_avl_tree_dict_keys(self):
     d = AvlTreeDict()
     d[1] = 2
     d[2] = 3
     self.assertEquals(d.keys(), [1, 2])
Example #7
0
 def test_avl_tree_dict_items(self):
     d = AvlTreeDict()
     d[1] = 2
     self.assertEquals(d.items(), [(1, 2)])
Example #8
0
 def test_avl_tree_dict_get(self):
     d = AvlTreeDict()
     d[1] = 2
     self.assertEquals(d.get(1), 2)
Example #9
0
 def test_avl_tree_dict_copy(self):
     d = AvlTreeDict()
     d[1] = 1
     self.assertEquals(d.copy(), {1: 1})
Example #10
0
 def test_avl_tree_dict_clear(self):
     d = AvlTreeDict()
     d[1] = 1
     d[2] = 1
     d.clear()
     self.assertEquals(d, AvlTreeDict())
Example #11
0
 def test_avl_tree_dict_repr(self):
     d = AvlTreeDict()
     d[1] = 1
     self.assertEquals(d.__repr__(), "{1: 1}")
Example #12
0
 def test_avl_tree_dict_ne(self):
     d1 = AvlTreeDict()
     d1[1] = 1
     d2 = AvlTreeDict()
     d2[1] = 2
     self.assertEquals(d1 != d2, True)
Example #13
0
 def test_avl_tree_dict_eq2(self):
     d1 = AvlTreeDict()
     d1[1] = 1
     d2 = AvlTreeDict()
     d2[1] = 2
     self.assertEquals(d1 == d2, False)
Example #14
0
 def test_avl_tree_dict_contains(self):
     d = AvlTreeDict()
     d[1] = 1
     self.assertEquals(1 in d, True)
Example #15
0
 def test_avl_tree_dict_delitem(self):
     d = AvlTreeDict()
     d[1] = 1
     del d[1]
     self.assertEquals(len(d), 0)
Example #16
0
 def test_avl_tree_dict_setdefault2(self):
     d = AvlTreeDict()
     d.setdefault(1, 231)
     self.assertEquals(d[1], 231)
Example #17
0
 def test_avl_tree_dict_fromkeys(self):
     d = AvlTreeDict()
     self.assertEquals(d.fromkeys([1, 2, 3]), {1: None, 2: None, 3: None})
Example #18
0
 def test_avl_tree_dict_setitem2(self):
     d = AvlTreeDict()
     d[1] = 1
     d[1] = 2
     self.assertEquals(d[1], 2)