diff options
author | Anthon van der Neut <anthon@mnt.org> | 2016-02-27 14:53:44 +0100 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2016-02-27 14:53:44 +0100 |
commit | 638b3d07b210f8636507c1530e925445f9c3aba9 (patch) | |
tree | d0c35dd79eae8ed610a9e33df8c3ea8b4e76a767 /_test/test_fail.py | |
parent | 0fbfd2d3f7895ebae49dc85abbe8844abb0e19bf (diff) | |
download | ruamel.yaml-638b3d07b210f8636507c1530e925445f9c3aba9.tar.gz |
implement indent for scalar list elements
Diffstat (limited to '_test/test_fail.py')
-rw-r--r-- | _test/test_fail.py | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/_test/test_fail.py b/_test/test_fail.py index de5bdb8..852fde7 100644 --- a/_test/test_fail.py +++ b/_test/test_fail.py @@ -87,13 +87,34 @@ class TestIndentFailures: a: - foo - bar - """), indent=4) == dedent(""" + """)) == dedent(""" a: - foo - bar """) @pytest.mark.xfail + def test_roundtrip_four_space_indents_expl_indent(self): + s = ( + 'a:\n' + '- foo\n' + '- bar\n' + ) + output = round_trip_dump(round_trip_load(s), indent=4) + assert s == output + + def test_roundtrip_four_space_indents_expl_indent_no_fail(self): + assert round_trip_dump(round_trip_load(""" + a: + - foo + - bar + """), indent=4) == dedent(""" + a: + - foo + - bar + """) + + @pytest.mark.xfail def test_indent_not_retained(self): round_trip(""" verbosity: 1 # 0 is minimal output, -1 none @@ -145,9 +166,9 @@ class TestIndentFailures: base_url: http://gopher.net special_indices: [1, 5, 8] also_special: - - a - - 19 - - 32 + - a + - 19 + - 32 asia and europe: &asia_europe Turkey: Ankara Russia: Moscow @@ -160,17 +181,10 @@ class TestIndentFailures: Spain: Madrid Italy: Rome Antarctica: - - too cold + - too cold """) - @pytest.mark.xfail - def test_indent_top_level(self): - round_trip(""" - - a: - - b - """, indent=4) - - def test_indent_top_level_no_fail(self): + def Xtest_indent_top_level_no_fail(self): round_trip(""" - a: - b |