diff options
author | Anthon van der Neut <anthon@mnt.org> | 2019-08-15 13:14:08 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2019-08-15 13:14:08 +0200 |
commit | c3ac95be03b0166b5910675f1d07c4d00db9dff8 (patch) | |
tree | 4f176d05d3ae63b68a50b7bbcf027d4fb2088de3 /_test | |
parent | ff8e03fe5542a9d7930a5720450c59bb9e9eaaf3 (diff) | |
download | ruamel.yaml-c3ac95be03b0166b5910675f1d07c4d00db9dff8.tar.gz |
allow # in 1.2 URI's0.16.2
fixes issue #305
*When this change indeed resolves your problem, please **Close** this issue*.
*(You can do so using the WorkFlow pull-down (close to the top right of this page))*
Diffstat (limited to '_test')
-rw-r--r-- | _test/roundtrip.py | 6 | ||||
-rw-r--r-- | _test/test_issues.py | 19 |
2 files changed, 16 insertions, 9 deletions
diff --git a/_test/roundtrip.py b/_test/roundtrip.py index 090b9e0..af8a555 100644 --- a/_test/roundtrip.py +++ b/_test/roundtrip.py @@ -169,6 +169,7 @@ def na_round_trip( inp: input string to parse outp: expected output (equals input if not specified) """ + inp = dedent(inp) if outp is None: outp = inp if version is not None: @@ -194,10 +195,7 @@ def na_round_trip( yaml.explicit_start = explicit_start yaml.explicit_end = explicit_end res = yaml.dump(data, compare=doutp) - #if res != doutp: - # diff(doutp, res, 'input string') - #print('\nroundtrip data:\n', res, sep="") - #assert res == doutp + return res def YAML(**kw): diff --git a/_test/test_issues.py b/_test/test_issues.py index 9b301a9..5606122 100644 --- a/_test/test_issues.py +++ b/_test/test_issues.py @@ -853,11 +853,20 @@ class TestIssues: def test_issue_304(self): inp = """ - %YAML 1.2 - %TAG ! tag:example.com,2019: - --- - !foo null - ... + %YAML 1.2 + %TAG ! tag:example.com,2019: + --- + !foo null + ... + """ + d = na_round_trip(inp) # NOQA + + def test_issue_305(self): + inp = """ + %YAML 1.2 + --- + !<tag:example.com,2019/path#foo> null + ... """ d = na_round_trip(inp) # NOQA |