Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
    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))
Ejemplo n.º 3
0
 def test_escape_quotes(self):
     hw = HTTPSPeeper()
     self.assertIn("\'", hw._escape_quotes("'", q="'"))
Ejemplo n.º 4
0
 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])