summaryrefslogtreecommitdiff
path: root/_test
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2018-08-12 20:21:22 +0200
committerAnthon van der Neut <anthon@mnt.org>2018-08-12 20:21:22 +0200
commit3d972c045bab860b93ee6c28c61dabeafe81d7e9 (patch)
treea05e2a1fb14aad3883af1d3b4507cc12ce70cc6c /_test
parentbf95947e11492f1060819036694daed38237d10e (diff)
downloadruamel.yaml-3d972c045bab860b93ee6c28c61dabeafe81d7e9.tar.gz
fix issue #172 compact JSON no longer parsing
This was quite intrusive, because loosing the tests surrounding the colon made flow style lists with ::vector as key fail. Had to keept track of whether in a flow-style mapping or sequence to get this solved *When this change indeed resolves your problem, please **Close** this issue*. *(You can do so usingthe WorkFlow pull-down (close to the top right of this page)*
Diffstat (limited to '_test')
-rw-r--r--_test/test_issues.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/_test/test_issues.py b/_test/test_issues.py
index 7e95857..4ddec2a 100644
--- a/_test/test_issues.py
+++ b/_test/test_issues.py
@@ -44,7 +44,7 @@ class TestIssues:
key-A:{}
mapping-B:
""")
- for comment in ['', ' # no-newline', ' # some comment\n', '\n', ]:
+ for comment in ['', ' # no-newline', ' # some comment\n', '\n']:
s = yaml_str.format(comment)
res = round_trip(s) # NOQA
@@ -65,3 +65,15 @@ class TestIssues:
- {}
""")
x = round_trip(s, preserve_quotes=True) # NOQA
+
+ json_str = (
+ '{"sshKeys":[{"name":"AETROS\/google-k80-1","uses":0,"getLastUse":0,'
+ '"fingerprint":"MD5:19:dd:41:93:a1:a3:f5:91:4a:8e:9b:d0:ae:ce:66:4c",'
+ '"created":1509497961}]}'
+ )
+
+ json_str2 = '{"abc":[{"a":"1", "uses":0}]}'
+
+ def test_issue_172(self):
+ x = round_trip_load(TestIssues.json_str2)
+ x = round_trip_load(TestIssues.json_str)