def test_copy():
    d = DefaultOrderedDict(list, [('a', [1, 2]), ('b', [3, 4])])
    d_copied = copy.copy(d)

    assert d_copied == d
    assert d.default_factory == d_copied.default_factory
    assert d_copied['a'] is d['a']
    assert d_copied['b'] is d['b']

    d_copied = d.copy()

    assert d_copied == d
    assert d.default_factory == d_copied.default_factory
    assert d_copied['a'] is d['a']
    assert d_copied['b'] is d['b']
def test_copy():
    d = DefaultOrderedDict(list, [('a', [1, 2]), ('b', [3, 4])])
    d_copied = copy.copy(d)

    assert d_copied == d
    assert d.default_factory == d_copied.default_factory
    assert d_copied['a'] is d['a']
    assert d_copied['b'] is d['b']

    d_copied = d.copy()

    assert d_copied == d
    assert d.default_factory == d_copied.default_factory
    assert d_copied['a'] is d['a']
    assert d_copied['b'] is d['b']
Exemplo n.º 3
0
def test_copy():
    d = DefaultOrderedDict(list, [("a", [1, 2]), ("b", [3, 4])])
    d_copied = copy.copy(d)

    assert d_copied == d
    assert d.default_factory == d_copied.default_factory
    assert d_copied["a"] is d["a"]
    assert d_copied["b"] is d["b"]

    d_copied = d.copy()

    assert d_copied == d
    assert d.default_factory == d_copied.default_factory
    assert d_copied["a"] is d["a"]
    assert d_copied["b"] is d["b"]