aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_flow.py12
-rw-r--r--test/tutils.py4
2 files changed, 4 insertions, 12 deletions
diff --git a/test/test_flow.py b/test/test_flow.py
index 89577ddb..1394a668 100644
--- a/test/test_flow.py
+++ b/test/test_flow.py
@@ -2,6 +2,7 @@ import Queue, time
from cStringIO import StringIO
import email.utils
from libmproxy import filt, flow, controller, utils, tnetstring
+from netlib import certutils
import tutils
import libpry
@@ -865,17 +866,6 @@ class TestResponse:
c = "MOO=BAR; Expires=Tue, 08-Mar-2011 00:20:38 GMT; Path=foo.com; Secure"
assert "00:21:38" in r._refresh_cookie(c, 60)
- def test_get_cert(self):
- req = tutils.treq()
- resp = flow.Response(
- req, (1, 1), 200, "msg", flow.ODictCaseless(), "content",
- file(tutils.test_data.path("data/dercert")).read()
- )
- assert resp.get_cert()
-
- resp = tutils.tresp()
- assert not resp.get_cert()
-
def test_getset_state(self):
h = flow.ODictCaseless()
h["test"] = ["test"]
diff --git a/test/tutils.py b/test/tutils.py
index da1cf662..79a1da39 100644
--- a/test/tutils.py
+++ b/test/tutils.py
@@ -2,6 +2,7 @@ import threading, Queue, time
import os, shutil, tempfile
from contextlib import contextmanager
from libmproxy import proxy, flow, controller, utils
+from netlib import certutils
import human_curl as hurl
import libpathod.test
import random
@@ -19,7 +20,8 @@ def tresp(req=None):
req = treq()
headers = flow.ODictCaseless()
headers["header_response"] = ["svalue"]
- return flow.Response(req, (1, 1), 200, "message", headers, "content_response", None)
+ cert = certutils.SSLCert.from_der(file(test_data.path("data/dercert")).read())
+ return flow.Response(req, (1, 1), 200, "message", headers, "content_response", cert)
def tflow():