2014-02-07 03:15:24 +00:00
|
|
|
import mock, socket, os, time
|
2014-02-07 01:36:39 +00:00
|
|
|
from libmproxy import dump
|
2014-02-07 03:15:24 +00:00
|
|
|
from netlib import certutils, tcp
|
2014-02-07 01:36:39 +00:00
|
|
|
from libpathod.pathoc import Pathoc
|
2014-02-07 23:33:59 +00:00
|
|
|
import tutils, tservers
|
2014-02-07 01:36:39 +00:00
|
|
|
|
2014-02-07 23:33:59 +00:00
|
|
|
class TestApp(tservers.HTTPProxTest):
|
2014-02-07 01:36:39 +00:00
|
|
|
def test_basic(self):
|
2014-02-07 23:33:59 +00:00
|
|
|
assert self.app("/").status_code == 200
|
2014-02-07 01:36:39 +00:00
|
|
|
|
|
|
|
def test_cert(self):
|
|
|
|
with tutils.tmpdir() as d:
|
|
|
|
for ext in ["pem", "p12"]:
|
2014-02-07 23:33:59 +00:00
|
|
|
resp = self.app("/cert/%s" % ext)
|
2014-02-07 01:36:39 +00:00
|
|
|
assert resp.status_code == 200
|
2014-03-05 04:25:12 +00:00
|
|
|
assert resp.content
|
2014-02-07 01:36:39 +00:00
|
|
|
|