mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-30 03:14:22 +00:00
20 lines
641 B
Python
20 lines
641 B
Python
import mock, socket, os, time
|
|
from libmproxy import dump
|
|
from netlib import certutils, tcp
|
|
from libpathod.pathoc import Pathoc
|
|
import tutils, tservers
|
|
|
|
class TestApp(tservers.HTTPProxTest):
|
|
def test_basic(self):
|
|
assert self.app("/").status_code == 200
|
|
|
|
def test_cert(self):
|
|
path = tutils.test_data.path("data/confdir/") + "mitmproxy-ca-cert."
|
|
with tutils.tmpdir() as d:
|
|
for ext in ["pem", "p12"]:
|
|
resp = self.app("/cert/%s" % ext)
|
|
assert resp.status_code == 200
|
|
with open(path + ext, "rb") as f:
|
|
assert resp.content == f.read()
|
|
|