Beispiel #1
0
 def test_values(self):
     ht = TreeMap()
     assert ht.values() == []
     ht.set('I', 1)
     assert ht.values() == [1]
     ht.set('V', 5)
     self.assertCountEqual(ht.values(), [1, 5])  # Ignore item order
     ht.set('X', 10)
     self.assertCountEqual(ht.values(), [1, 5, 10])  # Ignore item order
Beispiel #2
0
 def test_values(self):
     tm = TreeMap({"c": "A", "b": "B", "a": "C"})
     self.assertSequenceEqual(["C", "B", "A"], list(tm.values()))
Beispiel #3
0
    def test_values(self):
        tree = TreeMap([(2, 'B'), (1, 'A'), (3, 'C')])
        assert tree.values() == ['A', 'B', 'C']

        tree = TreeMap([('B', 2), ('A', 1), ('C', 3)])
        assert tree.values() == [1,2,3]