diff options
Diffstat (limited to '_test/test_anchor.py')
-rw-r--r-- | _test/test_anchor.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/_test/test_anchor.py b/_test/test_anchor.py index 3838833..3a92036 100644 --- a/_test/test_anchor.py +++ b/_test/test_anchor.py @@ -396,6 +396,23 @@ class TestMergeKeysValues: ref -= 1 assert len(x) == ref + def test_issue_213_copy_of_merge(self): + from ruamel.yaml import YAML + yaml = YAML() + d = yaml.load("""\ + foo: &foo + a: a + foo2: + <<: *foo + b: b + """)['foo2'] + assert d['a'] == 'a' + d2 = d.copy() + assert d2['a'] == 'a' + d.pop('a') + assert 'a' not in d + assert 'a' in d2 + class TestDuplicateKeyThroughAnchor: def test_duplicate_key_00(self): |