diff options
author | Anthon van der Neut <anthon@mnt.org> | 2016-10-28 15:42:15 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2016-10-28 15:42:15 +0200 |
commit | cbbe40b4246fab799886078136d959e112fc60f0 (patch) | |
tree | fb22e0069108f50fc88dca79c4370aa4c3224961 /_test/test_yamlfile.py | |
parent | 6edb229b01177b9599c269ecf7588e89c0105b3a (diff) | |
download | ruamel.yaml-cbbe40b4246fab799886078136d959e112fc60f0.tar.gz |
Fix for issue #70 no preserve_quotes on _load_all0.12.15
Diffstat (limited to '_test/test_yamlfile.py')
-rw-r--r-- | _test/test_yamlfile.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/_test/test_yamlfile.py b/_test/test_yamlfile.py index 9b224b8..e7e31ca 100644 --- a/_test/test_yamlfile.py +++ b/_test/test_yamlfile.py @@ -192,3 +192,18 @@ class TestYAML: round_trip(s) assert d['c'][0].split('it.')[1] == '' assert d['c'][1].split('line.')[1] == '' + + def test_load_all_perserve_quotes(self): + s = dedent("""\ + a: 'hello' + --- + b: "goodbye" + """) + data = [] + for x in ruamel.yaml.round_trip_load_all(s, preserve_quotes=True): + data.append(x) + out = ruamel.yaml.dump_all(data, Dumper=ruamel.yaml.RoundTripDumper) + print(type(data[0]['a']), data[0]['a']) + # out = ruamel.yaml.round_trip_dump_all(data) + print(out) + assert out == s |