summaryrefslogtreecommitdiff
path: root/_test/test_issues.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2019-04-04 08:34:46 +0200
committerAnthon van der Neut <anthon@mnt.org>2019-04-04 08:34:46 +0200
commit3d039055e72a8f3185089a2b9f1f162c6f453a77 (patch)
tree254a95bb590bd8b5174ad7b0f589c037073155e4 /_test/test_issues.py
parent24bdc0073466057ba9288282f943205a32f3cdc8 (diff)
downloadruamel.yaml-3d039055e72a8f3185089a2b9f1f162c6f453a77.tar.gz
fix update CommentedMap with list of tuples0.15.90
fixes issue #282 *When this change indeed resolves your problem, please **Close** this issue*. *(You can do so using the WorkFlow pull-down (close to the top right of this page))*
Diffstat (limited to '_test/test_issues.py')
-rw-r--r--_test/test_issues.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/_test/test_issues.py b/_test/test_issues.py
index 0d1a43d..5007f60 100644
--- a/_test/test_issues.py
+++ b/_test/test_issues.py
@@ -603,6 +603,16 @@ class TestIssues:
with pytest.raises(RepresenterError, match='cannot represent'):
yaml.dump({'t': t}, stdout)
+ def test_issue_282(self):
+ # update from list of tuples caused AttributeError
+ import ruamel.yaml
+ yaml_data = ruamel.yaml.comments.CommentedMap([('a', 'apple'), ('b', 'banana')])
+ yaml_data.update([('c', 'cantaloupe')])
+ yaml_data.update({'d': 'date', 'k': 'kiwi'})
+ assert 'c' in yaml_data.keys()
+ assert 'c' in yaml_data._ok
+
+
# @pytest.mark.xfail(strict=True, reason='bla bla', raises=AssertionError)
# def test_issue_ xxx(self):
# inp = """