diff options
author | Anthon van der Neut <anthon@mnt.org> | 2018-08-12 09:58:37 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2018-08-12 09:58:37 +0200 |
commit | fbfd585d20035ef6a4ebbfb4be28869715dccbbe (patch) | |
tree | 72b994b6d32ddda160f720affd75d8c79818fc2f | |
parent | 0b0cdab19e6ad83885485b4511822c9ed5c57769 (diff) | |
download | ruamel.yaml-fbfd585d20035ef6a4ebbfb4be28869715dccbbe.tar.gz |
ref issue #160 flow mapping with comments in sequence gobbles newline
-rw-r--r-- | _test/test_issues.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/_test/test_issues.py b/_test/test_issues.py index 5de34e2..a909b0e 100644 --- a/_test/test_issues.py +++ b/_test/test_issues.py @@ -9,7 +9,7 @@ import pytest # NOQA from roundtrip import round_trip, round_trip_load, round_trip_dump, dedent # NOQA -class TestIssue61: +class TestIssues: def test_issue_61(self): import ruamel.yaml @@ -25,3 +25,16 @@ class TestIssue61: data = ruamel.yaml.round_trip_load(s) assert str(data['comb']) == str(data['def']) assert str(data['comb']) == "ordereddict([('key', 'value'), ('key1', 'value1')])" + + def test_issue_160(self): + s = dedent("""\ + root: + # a comment + - {some_key: "value"} + + foo: 32 + bar: 32 + """) + x = round_trip(s, block_seq_indent=4, preserve_quotes=True) + assert x['bar'] == 32 + |