summaryrefslogtreecommitdiff
path: root/_test
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2019-08-15 13:14:08 +0200
committerAnthon van der Neut <anthon@mnt.org>2019-08-15 13:14:08 +0200
commitc3ac95be03b0166b5910675f1d07c4d00db9dff8 (patch)
tree4f176d05d3ae63b68a50b7bbcf027d4fb2088de3 /_test
parentff8e03fe5542a9d7930a5720450c59bb9e9eaaf3 (diff)
downloadruamel.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.py6
-rw-r--r--_test/test_issues.py19
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