def test_valid2(self): headers = Headers(content_type="application/json") j = export.is_json(headers, '{"name": "example", "email": "*****@*****.**"}') assert isinstance(j, dict)
def test_json_type(self): headers = Headers(content_type="application/json") assert export.is_json(headers, "foobar") is False
def test_valid(self): headers = Headers(content_type="application/foobar") j = export.is_json(headers, '{"name": "example", "email": "*****@*****.**"}') assert j is False
def test_empty(self): assert export.is_json(None, None) is False
def test_valid2(self): headers = Headers(content_type="application/json") j = export.is_json(headers, b'{"name": "example", "email": "*****@*****.**"}') assert isinstance(j, dict)
def test_valid(self): headers = Headers(content_type="application/foobar") j = export.is_json(headers, b'{"name": "example", "email": "*****@*****.**"}') assert j is False
def test_json_type(self): headers = Headers(content_type="application/json") assert export.is_json(headers, b"foobar") is False