Esempio n. 1
0
 def test_valid(self):
     headers = Headers(content_type="application/json")
     j = flow_export.is_json(headers, '{"name": "example", "email": "*****@*****.**"}')
     assert isinstance(j, dict)
Esempio n. 2
0
 def test_json_type(self):
     headers = Headers(content_type="application/json")
     assert flow_export.is_json(headers, "foobar") is False
Esempio n. 3
0
 def test_valid(self):
     headers = Headers(content_type="application/foobar")
     j = flow_export.is_json(headers, '{"name": "example", "email": "*****@*****.**"}')
     assert j is False
Esempio n. 4
0
 def test_empty(self):
     assert flow_export.is_json(None, None) is False