summaryrefslogtreecommitdiff
path: root/_test
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2019-02-27 22:57:46 +0100
committerAnthon van der Neut <anthon@mnt.org>2019-02-27 22:57:46 +0100
commitc716679edf348ba59d7551600c9cf139e23961ef (patch)
tree853ee5edd3b44aa67e182bb36b983dbb4ecf8f45 /_test
parent17af0e7a084955b5c0bf4124bba87190ac16734d (diff)
downloadruamel.yaml-c716679edf348ba59d7551600c9cf139e23961ef.tar.gz
fix issue #279 block sequence elements with flow mapping collapsed0.15.89
*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')
-rw-r--r--_test/test_issues.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/_test/test_issues.py b/_test/test_issues.py
index d5913f6..4780da5 100644
--- a/_test/test_issues.py
+++ b/_test/test_issues.py
@@ -560,6 +560,26 @@ class TestIssues:
"""
d = round_trip(inp) # NOQA
+ # @pytest.mark.xfail(strict=True, reason='bla bla', raises=AssertionError)
+ def test_issue_279(self):
+ from ruamel.yaml import YAML
+ from ruamel.yaml.compat import StringIO
+
+ yaml = YAML()
+ yaml.indent(sequence=4, offset=2)
+ inp = dedent("""\
+ experiments:
+ - datasets:
+ # ATLAS EWK
+ - {dataset: ATLASWZRAP36PB, frac: 1.0}
+ - {dataset: ATLASZHIGHMASS49FB, frac: 1.0}
+ """)
+ a = yaml.load(inp)
+ buf = StringIO()
+ yaml.dump(a, buf)
+ print(buf.getvalue())
+ assert buf.getvalue() == inp
+
def test_issue_280(self):
from ruamel.yaml import YAML
from ruamel.yaml.representer import RepresenterError
@@ -576,6 +596,3 @@ class TestIssues:
# inp = """
# """
# d = round_trip(inp) # NOQA
-
-
-