aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_certutils.py7
-rw-r--r--test/test_http_auth.py5
-rw-r--r--test/test_http_cookies.py3
-rw-r--r--test/test_imports.py2
-rw-r--r--test/test_wsgi.py4
5 files changed, 7 insertions, 14 deletions
diff --git a/test/test_certutils.py b/test/test_certutils.py
index 4af0197f..115cac4d 100644
--- a/test/test_certutils.py
+++ b/test/test_certutils.py
@@ -1,6 +1,5 @@
import os
from netlib import certutils, certffi
-import OpenSSL
import tutils
# class TestDNTree:
@@ -57,13 +56,13 @@ class TestCertStore:
def test_add_cert(self):
with tutils.tmpdir() as d:
- ca = certutils.CertStore.from_store(d, "test")
+ certutils.CertStore.from_store(d, "test")
def test_sans(self):
with tutils.tmpdir() as d:
ca = certutils.CertStore.from_store(d, "test")
c1 = ca.get_cert("foo.com", ["*.bar.com"])
- c2 = ca.get_cert("foo.bar.com", [])
+ ca.get_cert("foo.bar.com", [])
# assert c1 == c2
c3 = ca.get_cert("bar.com", [])
assert not c1 == c3
@@ -71,7 +70,7 @@ class TestCertStore:
def test_sans_change(self):
with tutils.tmpdir() as d:
ca = certutils.CertStore.from_store(d, "test")
- _ = ca.get_cert("foo.com", ["*.bar.com"])
+ ca.get_cert("foo.com", ["*.bar.com"])
cert, key, chain_file = ca.get_cert("foo.bar.com", ["*.baz.com"])
assert "*.baz.com" in cert.altnames
diff --git a/test/test_http_auth.py b/test/test_http_auth.py
index 25df5410..045fb13e 100644
--- a/test/test_http_auth.py
+++ b/test/test_http_auth.py
@@ -1,7 +1,4 @@
-import binascii
-import cStringIO
from netlib import odict, http_auth, http
-import mock
import tutils
@@ -22,7 +19,7 @@ class TestPassManHtpasswd:
pm = http_auth.PassManHtpasswd(tutils.test_data.path("data/htpasswd"))
vals = ("basic", "test", "test")
- p = http.assemble_http_basic_auth(*vals)
+ http.assemble_http_basic_auth(*vals)
assert pm.test("test", "test")
assert not pm.test("test", "foo")
assert not pm.test("foo", "test")
diff --git a/test/test_http_cookies.py b/test/test_http_cookies.py
index 7438af7c..070849cf 100644
--- a/test/test_http_cookies.py
+++ b/test/test_http_cookies.py
@@ -1,7 +1,6 @@
-import pprint
import nose.tools
-from netlib import http_cookies, odict
+from netlib import http_cookies
def test_read_token():
diff --git a/test/test_imports.py b/test/test_imports.py
index 7b8a643b..b88ef26d 100644
--- a/test/test_imports.py
+++ b/test/test_imports.py
@@ -1,3 +1 @@
# These are actually tests!
-import netlib.http_status
-import netlib.version
diff --git a/test/test_wsgi.py b/test/test_wsgi.py
index 68a47769..41572d49 100644
--- a/test/test_wsgi.py
+++ b/test/test_wsgi.py
@@ -56,7 +56,7 @@ class TestWSGI:
f.request.host = "foo"
f.request.port = 80
wfile = cStringIO.StringIO()
- err = w.serve(f, wfile)
+ w.serve(f, wfile)
return wfile.getvalue()
def test_serve_empty_body(self):
@@ -72,7 +72,7 @@ class TestWSGI:
try:
raise ValueError("foo")
except:
- ei = sys.exc_info()
+ sys.exc_info()
status = '200 OK'
response_headers = [('Content-type', 'text/plain')]
start_response(status, response_headers)