Improve parse_maybe_json.
This commit is contained in:
+3
-1
@@ -69,12 +69,14 @@ class TestFunctionality(TestBotBase):
|
||||
non_json_string = "This is not a JSON string."
|
||||
self.assertEqual(parse_maybe_json(non_json_string), non_json_string)
|
||||
json_array = '["value1", "value2", "value3"]'
|
||||
|
||||
expected_output = "value1\nvalue2\nvalue3"
|
||||
self.assertEqual(parse_maybe_json(json_array), expected_output)
|
||||
json_string = '"value1"'
|
||||
expected_output = 'value1'
|
||||
self.assertEqual(parse_maybe_json(json_string), expected_output)
|
||||
json_struct = '{"This is a string."}'
|
||||
expected_output = 'This is a string.'
|
||||
self.assertEqual(parse_maybe_json(json_struct), expected_output)
|
||||
|
||||
async def test_on_message_event(self) -> None:
|
||||
async def acreate(*a, **kw):
|
||||
|
||||
Reference in New Issue
Block a user