예제 #1
0
def test_indexeddict_last():
    a = IndexedDict(a=1, b=2, c=3, d=4)
    a.insert_after('d', 'e', 5)
    check.equal(a, {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5})
예제 #2
0
def test_indexeddict_existing_before_after():
    a = IndexedDict(a=1, b=2, c=3, d=4)
    a.insert_after('b', 'c', 3)
    check.equal(a, {'a': 1, 'c': 3, 'b': 2, 'd': 4})
예제 #3
0
def test_indexeddict_existing_after_after():
    a = IndexedDict(a=1, b=2, c=3, d=4, e=5)
    a.insert_after('e', 'c', 4)
    check.equal(a, {'a': 1, 'b': 2, 'd': 4, 'c': 4, 'e': 5})
예제 #4
0
 def test_indexeddict_after(self):
     a = IndexedDict(a=1, b=2, c=3, d=4)
     a.insert_after('b', 'e', 5)
     assert_equal(a, {'a': 1, 'b': 2, 'e': 5, 'c': 3, 'd': 4})