コード例 #1
0
ファイル: test_pyutils.py プロジェクト: rudnerlq/astropop
def test_indexeddict_create():
    d = dict(a=1, b=2, c=3)
    i = IndexedDict(a=1, b=2, c=3)
    check.is_instance(i, dict)
    check.equal(len(d), len(i))
    # Python 3.6 and above ensure items order
    check.equal(list(d.keys()), list(i.keys()))
    check.equal(list(d.values()), list(i.values()))
    check.equal(i, d)
コード例 #2
0
 def test_indexeddict_create(self):
     d = dict(a=1, b=2, c=3)
     i = IndexedDict(a=1, b=2, c=3)
     assert_is_instance(i, dict)
     assert_equal(len(d), len(i))
     # Python 3.6 and above ensure items order
     assert_equal(list(d.keys()), list(i.keys()))
     assert_equal(list(d.values()), list(i.values()))
     assert_equal(i, d)