コード例 #1
0
ファイル: test_flow_export.py プロジェクト: AlTune/mitmproxy
 def test_valid2(self):
     headers = Headers(content_type="application/json")
     j = export.is_json(headers, '{"name": "example", "email": "*****@*****.**"}')
     assert isinstance(j, dict)
コード例 #2
0
ファイル: test_flow_export.py プロジェクト: AlTune/mitmproxy
 def test_json_type(self):
     headers = Headers(content_type="application/json")
     assert export.is_json(headers, "foobar") is False
コード例 #3
0
ファイル: test_flow_export.py プロジェクト: AlTune/mitmproxy
 def test_valid(self):
     headers = Headers(content_type="application/foobar")
     j = export.is_json(headers, '{"name": "example", "email": "*****@*****.**"}')
     assert j is False
コード例 #4
0
ファイル: test_flow_export.py プロジェクト: AlTune/mitmproxy
 def test_empty(self):
     assert export.is_json(None, None) is False
コード例 #5
0
 def test_valid2(self):
     headers = Headers(content_type="application/json")
     j = export.is_json(headers, b'{"name": "example", "email": "*****@*****.**"}')
     assert isinstance(j, dict)
コード例 #6
0
 def test_valid(self):
     headers = Headers(content_type="application/foobar")
     j = export.is_json(headers, b'{"name": "example", "email": "*****@*****.**"}')
     assert j is False
コード例 #7
0
 def test_json_type(self):
     headers = Headers(content_type="application/json")
     assert export.is_json(headers, b"foobar") is False
コード例 #8
0
 def test_empty(self):
     assert export.is_json(None, None) is False