diff options
author | Anthony Sottile <asottile@umich.edu> | 2015-03-25 14:22:54 -0700 |
---|---|---|
committer | Anthony Sottile <asottile@umich.edu> | 2015-03-25 14:22:54 -0700 |
commit | 1c605a89c8a3c62670e147ed4eb9b0071692b9ab (patch) | |
tree | 56119300846e7f52840f1960bb04f46efdacec91 | |
parent | afdc24a93260e9869361cb7e9855740d2dbd04d3 (diff) | |
download | ruamel.yaml-1c605a89c8a3c62670e147ed4eb9b0071692b9ab.tar.gz |
Add failing tests for indentation
-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 |