diff options
author | Anthon van der Neut <bitbucket@ruamel.eu> | 2015-03-26 08:23:57 +0100 |
---|---|---|
committer | Anthon van der Neut <bitbucket@ruamel.eu> | 2015-03-26 08:23:57 +0100 |
commit | f9c4937a476eb9dae9fa0f54120c34957175aeff (patch) | |
tree | 93e497e2f854a28a01c95430e932bdf09b4e1252 | |
parent | 9e8a03f543e088c0d974ab1d1403deb075775d1c (diff) | |
parent | 1c605a89c8a3c62670e147ed4eb9b0071692b9ab (diff) | |
download | ruamel.yaml-f9c4937a476eb9dae9fa0f54120c34957175aeff.tar.gz |
Merged in asottile/yaml (pull request #1)
Add failing tests for indentation:
- allow round-trip preservation of sequence flow style for list
- allow round-trip preservation of space between block sequence dash and scalar
-rw-r--r-- | test/test_indentation.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/test_indentation.py b/test/test_indentation.py new file mode 100644 index 0000000..ae3604e --- /dev/null +++ b/test/test_indentation.py @@ -0,0 +1,32 @@ +from __future__ import absolute_import +from __future__ import print_function +from __future__ import unicode_literals + +import pytest + +import ruamel.yaml + + +def rt(s): + return ruamel.yaml.dump( + ruamel.yaml.load(s, Loader=ruamel.yaml.RoundTripLoader), + Dumper=ruamel.yaml.RoundTripDumper, + ).strip() + '\n' + + +@pytest.mark.xfail +def test_roundtrip_inline_list(): + s = 'a: [a, b, c]\n' + output = rt(s) + assert s == output + + +@pytest.mark.xfail +def test_roundtrip_four_space_indents(): + s = ( + 'a:\n' + '- foo\n' + '- bar\n' + ) + output = rt(s) + assert s == output |