示例#1
0
 def test_json_splitter_no_object(self):
     data = '{"foo": "bar'
     assert utils.json_splitter(data) is None
示例#2
0
 def test_json_splitter_leading_whitespace(self):
     data = '\n   \r{"foo": "bar"}\n\n   {"next": "obj"}'
     assert utils.json_splitter(data) == ({'foo': 'bar'}, '{"next": "obj"}')
示例#3
0
 def test_json_splitter_no_object(self):
     data = '{"foo": "bar'
     self.assertEqual(utils.json_splitter(data), (None, None))
示例#4
0
 def test_json_splitter_with_object(self):
     data = '{"foo": "bar"}\n  \n{"next": "obj"}'
     assert utils.json_splitter(data) == ({'foo': 'bar'}, '{"next": "obj"}')
示例#5
0
 def test_json_splitter_no_object(self):
     data = '{"foo": "bar'
     self.assertEqual(utils.json_splitter(data), (None, None))