Skip to content

Commit 90c9e90

Browse files
Boris Pleshakovsliverc
authored andcommitted
+ test
1 parent ffcfaef commit 90c9e90

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

example/tests/test_parsers.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,21 @@ def test_parse_invalid_data(self):
5252

5353
with self.assertRaises(ParseError):
5454
parser.parse(stream, None, self.parser_context)
55+
56+
def test_parse_invalid_data_key(self):
57+
parser = JSONParser()
58+
59+
string = json.dumps({
60+
'data': [{
61+
'id': 123,
62+
'type': 'Blog',
63+
'attributes': {
64+
'json-value': {'JsonKey': 'JsonValue'}
65+
},
66+
}]
67+
})
68+
stream = BytesIO(string.encode('utf-8'))
69+
70+
with self.assertRaises(ParseError):
71+
parser.parse(stream, None, self.parser_context)
72+

0 commit comments

Comments
 (0)