def test_simple(self): if os.path.exists(HTTPSPeeper.OUTPUT_DIR): shutil.rmtree(HTTPSPeeper.OUTPUT_DIR) hw = HTTPSPeeper() # If output dir exists, delete and try f = get_flow() hw.request(f) hw.response(f)
def test_stringify(self): hw = HTTPSPeeper() f = get_flow() self.assertTrue(isinstance(hw.stringify_request(f.request), str)) self.assertTrue(isinstance(hw.stringify_response(f.response), str))
def test_escape_quotes(self): hw = HTTPSPeeper() self.assertIn("\'", hw._escape_quotes("'", q="'"))
def test_beautify_json(self): hw = HTTPSPeeper() hw.beautify_json("{1:1}") hw.beautify_json("{") hw.beautify_json({1: 1}) hw.beautify_json([1, 1])