diff --git a/netlib/h2/frame.py b/netlib/h2/frame.py index d846b3b93..a7e81f48b 100644 --- a/netlib/h2/frame.py +++ b/netlib/h2/frame.py @@ -1,10 +1,6 @@ -import base64 -import hashlib -import os import struct -import io -from .. import utils, odict, tcp +from .. import utils from functools import reduce diff --git a/netlib/h2/h2.py b/netlib/h2/h2.py index 1a39a635a..7a85226fd 100644 --- a/netlib/h2/h2.py +++ b/netlib/h2/h2.py @@ -1,8 +1,3 @@ -import base64 -import hashlib -import os -import struct -import io # "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" CLIENT_CONNECTION_PREFACE = '505249202a20485454502f322e300d0a0d0a534d0d0a0d0a' diff --git a/netlib/http_auth.py b/netlib/http_auth.py index 261b6654b..0143760cd 100644 --- a/netlib/http_auth.py +++ b/netlib/http_auth.py @@ -16,7 +16,6 @@ class NullProxyAuth(object): """ Clean up authentication headers, so they're not passed upstream. """ - pass def authenticate(self, headers): """ diff --git a/netlib/http_cookies.py b/netlib/http_cookies.py index 73e3f5895..5cb39e5ca 100644 --- a/netlib/http_cookies.py +++ b/netlib/http_cookies.py @@ -67,7 +67,6 @@ def _read_quoted_string(s, start): break elif s[i] == "\\": escaping = True - pass else: ret.append(s[i]) return "".join(ret), i + 1 diff --git a/netlib/tcp.py b/netlib/tcp.py index 7c1155546..49f92e4ac 100644 --- a/netlib/tcp.py +++ b/netlib/tcp.py @@ -7,7 +7,6 @@ import threading import time import traceback from OpenSSL import SSL -import OpenSSL from . import certutils @@ -650,4 +649,3 @@ class TCPServer(object): """ Called after server shutdown. """ - pass diff --git a/test/test_certutils.py b/test/test_certutils.py index 4af0197fa..115cac4d1 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 25df54101..045fb13ee 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 7438af7ca..070849cf5 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 7b8a643bc..b88ef26d0 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 68a47769d..41572d494 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)