コード例 #1
0
ファイル: test_pyutils.py プロジェクト: rudnerlq/astropop
def test_indexeddict_first():
    a = IndexedDict(a=1, b=2, c=3, d=4)
    a.insert_before('a', 'e', 5)
    check.equal(a, {'e': 5, 'a': 1, 'b': 2, 'c': 3, 'd': 4})
コード例 #2
0
ファイル: test_pyutils.py プロジェクト: rudnerlq/astropop
def test_indexeddict_existing_before_before():
    a = IndexedDict(a=1, b=2, c=3, d=4)
    a.insert_before('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_before():
    a = IndexedDict(a=1, b=2, c=3, d=4, e=5)
    a.insert_before('e', 'c', 4)
    check.equal(a, {'a': 1, 'b': 2, 'd': 4, 'c': 4, 'e': 5})
コード例 #4
0
 def test_indexeddict_before(self):
     a = IndexedDict(a=1, b=2, c=3, d=4)
     a.insert_before('b', 'e', 5)
     assert_equal(a, {'a': 1, 'e': 5, 'b': 2, 'c': 3, 'd': 4})