コード例 #1
0
ファイル: test_pyutils.py プロジェクト: rudnerlq/astropop
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
ファイル: test_pyutils.py プロジェクト: rudnerlq/astropop
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
ファイル: test_pyutils.py プロジェクト: rudnerlq/astropop
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})