summaryrefslogtreecommitdiff
path: root/_test/test_api_change.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2017-06-09 07:07:18 +0200
committerAnthon van der Neut <anthon@mnt.org>2017-06-09 07:07:18 +0200
commitcb15ef0ad512c00584ff4195ca88334d1f2b0fa6 (patch)
tree71839804b30b9c92c4a2d8243529c4704de5cf30 /_test/test_api_change.py
parent4b847b7d4706726c3a32f158fd480e61b6c3019f (diff)
downloadruamel.yaml-cb15ef0ad512c00584ff4195ca88334d1f2b0fa6.tar.gz
rt set handling now checks for duplicate keys
Diffstat (limited to '_test/test_api_change.py')
-rw-r--r--_test/test_api_change.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/_test/test_api_change.py b/_test/test_api_change.py
index e33e8bc..bd56881 100644
--- a/_test/test_api_change.py
+++ b/_test/test_api_change.py
@@ -7,6 +7,7 @@ testing of anchors and the aliases referring to them
"""
import sys
+import textwrap
import pytest
from ruamel.yaml import YAML
from ruamel.yaml.constructor import DuplicateKeyError
@@ -97,3 +98,17 @@ class TestRead:
yaml = YAML()
yaml.load('a: 1')
yaml.load('a: 1') # did not work in 0.15.4
+
+
+class TestDuplSet:
+ def test_dupl_set_00(self):
+ # round-trip-loader should except
+ yaml = YAML()
+ with pytest.raises(DuplicateKeyError):
+ yaml.load(textwrap.dedent("""\
+ !!set
+ ? a
+ ? b
+ ? c
+ ? a
+ """))