diff options
Diffstat (limited to 'test')
35 files changed, 71 insertions, 87 deletions
diff --git a/test/mitmproxy/__init__.py b/test/mitmproxy/__init__.py index 61d03152..fdb35964 100644 --- a/test/mitmproxy/__init__.py +++ b/test/mitmproxy/__init__.py @@ -1,4 +1,3 @@ -from __future__ import (print_function, absolute_import, division) # Silence third-party modules import logging diff --git a/test/mitmproxy/builtins/test_filestreamer.py b/test/mitmproxy/builtins/test_filestreamer.py index 7964c69a..6de2d8e7 100644 --- a/test/mitmproxy/builtins/test_filestreamer.py +++ b/test/mitmproxy/builtins/test_filestreamer.py @@ -1,4 +1,3 @@ -from __future__ import absolute_import, print_function, division from .. import tutils, mastertest diff --git a/test/mitmproxy/console/test_pathedit.py b/test/mitmproxy/console/test_pathedit.py index ff6ef846..45c69a38 100644 --- a/test/mitmproxy/console/test_pathedit.py +++ b/test/mitmproxy/console/test_pathedit.py @@ -51,7 +51,7 @@ class TestPathCompleter: assert c.final == s -class TestPathEdit(): +class TestPathEdit: def test_keypress(self): diff --git a/test/mitmproxy/protocol/test_http1.py b/test/mitmproxy/protocol/test_http1.py index 2fc4ac63..e6346d72 100644 --- a/test/mitmproxy/protocol/test_http1.py +++ b/test/mitmproxy/protocol/test_http1.py @@ -1,4 +1,3 @@ -from __future__ import (absolute_import, print_function, division) from netlib.http import http1 from netlib.tcp import TCPClient @@ -6,7 +5,7 @@ from netlib.tutils import treq from .. import tutils, tservers -class TestHTTPFlow(object): +class TestHTTPFlow: def test_repr(self): f = tutils.tflow(resp=True, err=True) diff --git a/test/mitmproxy/protocol/test_http2.py b/test/mitmproxy/protocol/test_http2.py index c4bd2049..e6b13a05 100644 --- a/test/mitmproxy/protocol/test_http2.py +++ b/test/mitmproxy/protocol/test_http2.py @@ -1,6 +1,5 @@ # coding=utf-8 -from __future__ import (absolute_import, print_function, division) import pytest import os @@ -89,7 +88,7 @@ class _Http2ServerBase(netlib_tservers.ServerTestBase): raise NotImplementedError() -class _Http2TestBase(object): +class _Http2TestBase: @classmethod def setup_class(cls): diff --git a/test/mitmproxy/protocol/test_websockets.py b/test/mitmproxy/protocol/test_websockets.py index e2361d89..88145b30 100644 --- a/test/mitmproxy/protocol/test_websockets.py +++ b/test/mitmproxy/protocol/test_websockets.py @@ -1,4 +1,3 @@ -from __future__ import absolute_import, print_function, division import pytest import os @@ -44,7 +43,7 @@ class _WebSocketsServerBase(netlib_tservers.ServerTestBase): traceback.print_exc() -class _WebSocketsTestBase(object): +class _WebSocketsTestBase: @classmethod def setup_class(cls): diff --git a/test/mitmproxy/test_addons.py b/test/mitmproxy/test_addons.py index c5d54e8c..eb35d15b 100644 --- a/test/mitmproxy/test_addons.py +++ b/test/mitmproxy/test_addons.py @@ -1,4 +1,3 @@ -from __future__ import absolute_import, print_function, division from mitmproxy import addons from mitmproxy import controller from mitmproxy import options diff --git a/test/mitmproxy/test_controller.py b/test/mitmproxy/test_controller.py index 660ce111..d4368d07 100644 --- a/test/mitmproxy/test_controller.py +++ b/test/mitmproxy/test_controller.py @@ -15,7 +15,7 @@ class TMsg: pass -class TestMaster(object): +class TestMaster: def test_simple(self): class DummyMaster(controller.Master): @controller.handler @@ -24,7 +24,7 @@ class TestMaster(object): def tick(self, timeout): # Speed up test - super(DummyMaster, self).tick(0) + super().tick(0) m = DummyMaster(None) assert not m.should_exit.is_set() @@ -44,7 +44,7 @@ class TestMaster(object): m.shutdown() -class TestServerThread(object): +class TestServerThread: def test_simple(self): m = Mock() t = controller.ServerThread(m) @@ -52,7 +52,7 @@ class TestServerThread(object): assert m.serve_forever.called -class TestChannel(object): +class TestChannel: def test_tell(self): q = queue.Queue() channel = controller.Channel(q, Event()) @@ -86,7 +86,7 @@ class TestChannel(object): channel.ask("test", Mock(name="test_ask_shutdown")) -class TestReply(object): +class TestReply: def test_simple(self): reply = controller.Reply(42) assert reply.state == "unhandled" @@ -179,7 +179,7 @@ class TestReply(object): reply.commit() -class TestDummyReply(object): +class TestDummyReply: def test_simple(self): reply = controller.DummyReply() for _ in range(2): diff --git a/test/mitmproxy/test_examples.py b/test/mitmproxy/test_examples.py index 81e8801c..05b7544f 100644 --- a/test/mitmproxy/test_examples.py +++ b/test/mitmproxy/test_examples.py @@ -99,7 +99,7 @@ class TestScripts(mastertest.MasterTest): assert f.request.host == "mitmproxy.org" -class TestHARDump(): +class TestHARDump: def flow(self, resp_content=b'message'): times = dict( diff --git a/test/mitmproxy/test_flow.py b/test/mitmproxy/test_flow.py index cc9d2691..38d61afe 100644 --- a/test/mitmproxy/test_flow.py +++ b/test/mitmproxy/test_flow.py @@ -37,7 +37,7 @@ def test_app_registry(): assert ar.get(r) -class TestHTTPFlow(object): +class TestHTTPFlow: def test_copy(self): f = tutils.tflow(resp=True) diff --git a/test/mitmproxy/test_flow_export.py b/test/mitmproxy/test_flow_export.py index 86ff937d..920f538b 100644 --- a/test/mitmproxy/test_flow_export.py +++ b/test/mitmproxy/test_flow_export.py @@ -31,7 +31,7 @@ def req_patch(): return netlib.tutils.treq(method=b'PATCH', path=b"/path?query=param") -class TestExportCurlCommand(): +class TestExportCurlCommand: def test_get(self): flow = tutils.tflow(req=req_get()) result = """curl -H 'header:qvalue' -H 'content-length:7' 'http://address/path?a=foo&a=bar&b=baz'""" @@ -48,7 +48,7 @@ class TestExportCurlCommand(): assert export.curl_command(flow) == result -class TestExportPythonCode(): +class TestExportPythonCode: def test_get(self): flow = tutils.tflow(req=req_get()) python_equals("data/test_flow_export/python_get.py", export.python_code(flow)) @@ -69,7 +69,7 @@ class TestExportPythonCode(): python_equals("data/test_flow_export/python_patch.py", export.python_code(flow)) -class TestExportLocustCode(): +class TestExportLocustCode: def test_get(self): flow = tutils.tflow(req=req_get()) python_equals("data/test_flow_export/locust_get.py", export.locust_code(flow)) @@ -86,7 +86,7 @@ class TestExportLocustCode(): python_equals("data/test_flow_export/locust_patch.py", export.locust_code(flow)) -class TestExportLocustTask(): +class TestExportLocustTask: def test_get(self): flow = tutils.tflow(req=req_get()) python_equals("data/test_flow_export/locust_task_get.py", export.locust_task(flow)) @@ -100,7 +100,7 @@ class TestExportLocustTask(): python_equals("data/test_flow_export/locust_task_patch.py", export.locust_task(flow)) -class TestIsJson(): +class TestIsJson: def test_empty(self): assert export.is_json(None, None) is False @@ -119,7 +119,7 @@ class TestIsJson(): assert isinstance(j, dict) -class TestURL(): +class TestURL: def test_url(self): flow = tutils.tflow() assert export.url(flow) == "http://address:22/path" diff --git a/test/mitmproxy/test_optmanager.py b/test/mitmproxy/test_optmanager.py index 8414e6b5..1d677bd3 100644 --- a/test/mitmproxy/test_optmanager.py +++ b/test/mitmproxy/test_optmanager.py @@ -1,4 +1,3 @@ -from __future__ import absolute_import, print_function, division import copy from mitmproxy import optmanager @@ -10,7 +9,7 @@ class TO(optmanager.OptManager): def __init__(self, one=None, two=None): self.one = one self.two = two - super(TO, self).__init__() + super().__init__() def test_options(): diff --git a/test/mitmproxy/test_proxy.py b/test/mitmproxy/test_proxy.py index f7c64e50..5904ce5b 100644 --- a/test/mitmproxy/test_proxy.py +++ b/test/mitmproxy/test_proxy.py @@ -14,7 +14,7 @@ from netlib.http import http1 from . import tutils -class TestServerConnection(object): +class TestServerConnection: def test_simple(self): self.d = test.Daemon() diff --git a/test/mitmproxy/test_server.py b/test/mitmproxy/test_server.py index ec59fbdf..923d8ccf 100644 --- a/test/mitmproxy/test_server.py +++ b/test/mitmproxy/test_server.py @@ -449,7 +449,7 @@ class TestHTTPSUpstreamServerVerificationWBadCert(tservers.HTTPProxyTest): @classmethod def get_options(cls): - opts = super(tservers.HTTPProxyTest, cls).get_options() + opts = super().get_options() opts.ssl_verify_upstream_trusted_ca = tutils.test_data.path( "data/servercert/trusted-root.pem" ) @@ -540,7 +540,7 @@ class TestHttps2Http(tservers.ReverseProxyTest): @classmethod def get_options(cls): - opts = super(TestHttps2Http, cls).get_options() + opts = super().get_options() s = parse_server_spec(opts.upstream_server) opts.upstream_server = "http://%s" % s.address return opts @@ -700,13 +700,13 @@ class MasterRedirectRequest(tservers.TestMaster): # This is the actual redirection. f.request.port = self.redirect_port - super(MasterRedirectRequest, self).request(f) + super().request(f) @controller.handler def response(self, f): f.response.content = bytes(f.client_conn.address.port) f.response.headers["server-conn-id"] = str(f.server_conn.source_address.port) - super(MasterRedirectRequest, self).response(f) + super().response(f) class TestRedirectRequest(tservers.HTTPProxyTest): @@ -954,19 +954,19 @@ class TestUpstreamProxySSL( delattr(self, "_ignore_%s_backup" % attr) def _ignore_on(self): - super(TestUpstreamProxySSL, self)._ignore_on() + super()._ignore_on() self._host_pattern_on("ignore") def _ignore_off(self): - super(TestUpstreamProxySSL, self)._ignore_off() + super()._ignore_off() self._host_pattern_off("ignore") def _tcpproxy_on(self): - super(TestUpstreamProxySSL, self)._tcpproxy_on() + super()._tcpproxy_on() self._host_pattern_on("tcp") def _tcpproxy_off(self): - super(TestUpstreamProxySSL, self)._tcpproxy_off() + super()._tcpproxy_off() self._host_pattern_off("tcp") def test_simple(self): @@ -1110,7 +1110,7 @@ class TestHTTPSAddUpstreamCertsToClientChainTrue( """ @classmethod def get_options(cls): - opts = super(tservers.HTTPProxyTest, cls).get_options() + opts = super().get_options() opts.add_upstream_certs_to_client_chain = True return opts @@ -1125,6 +1125,6 @@ class TestHTTPSAddUpstreamCertsToClientChainFalse( """ @classmethod def get_options(cls): - opts = super(tservers.HTTPProxyTest, cls).get_options() + opts = super().get_options() opts.add_upstream_certs_to_client_chain = False return opts diff --git a/test/mitmproxy/tools/bench.py b/test/mitmproxy/tools/bench.py index 8127d083..fb75ef46 100644 --- a/test/mitmproxy/tools/bench.py +++ b/test/mitmproxy/tools/bench.py @@ -1,4 +1,3 @@ -from __future__ import print_function import requests import time diff --git a/test/mitmproxy/tools/benchtool.py b/test/mitmproxy/tools/benchtool.py index 17043676..bc68645c 100644 --- a/test/mitmproxy/tools/benchtool.py +++ b/test/mitmproxy/tools/benchtool.py @@ -18,7 +18,7 @@ class ApacheBenchThread(Thread): def __init__(self, concurrency): self.concurrency = concurrency - super(ApacheBenchThread, self).__init__() + super().__init__() def run(self): time.sleep(2) diff --git a/test/mitmproxy/tservers.py b/test/mitmproxy/tservers.py index d3806a99..431e0f90 100644 --- a/test/mitmproxy/tservers.py +++ b/test/mitmproxy/tservers.py @@ -74,7 +74,7 @@ class ProxyThread(threading.Thread): self.tmaster.shutdown() -class ProxyTestBase(object): +class ProxyTestBase: # Test Configuration ssl = None ssloptions = False @@ -203,7 +203,7 @@ class TransparentProxyTest(ProxyTestBase): @classmethod def setup_class(cls): - super(TransparentProxyTest, cls).setup_class() + super().setup_class() cls._resolver = mock.patch( "mitmproxy.platform.resolver", @@ -214,7 +214,7 @@ class TransparentProxyTest(ProxyTestBase): @classmethod def teardown_class(cls): cls._resolver.stop() - super(TransparentProxyTest, cls).teardown_class() + super().teardown_class() @classmethod def get_options(cls): @@ -308,7 +308,7 @@ class ChainProxyTest(ProxyTestBase): @classmethod def setup_class(cls): cls.chain = [] - super(ChainProxyTest, cls).setup_class() + super().setup_class() for _ in range(cls.n): opts = cls.get_options() config = ProxyConfig(opts) @@ -323,19 +323,19 @@ class ChainProxyTest(ProxyTestBase): @classmethod def teardown_class(cls): - super(ChainProxyTest, cls).teardown_class() + super().teardown_class() for proxy in cls.chain: proxy.shutdown() def setup(self): - super(ChainProxyTest, self).setup() + super().setup() for proxy in self.chain: proxy.tmaster.clear_log() proxy.tmaster.state.clear() @classmethod def get_options(cls): - opts = super(ChainProxyTest, cls).get_options() + opts = super().get_options() if cls.chain: # First proxy is in normal mode. opts.update( mode="upstream", diff --git a/test/mitmproxy/tutils.py b/test/mitmproxy/tutils.py index 575dacf0..2869a5f5 100644 --- a/test/mitmproxy/tutils.py +++ b/test/mitmproxy/tutils.py @@ -52,7 +52,7 @@ class DummyFlow(Flow): """A flow that is neither HTTP nor TCP.""" def __init__(self, client_conn, server_conn, live=None): - super(DummyFlow, self).__init__("dummy", client_conn, server_conn, live) + super().__init__("dummy", client_conn, server_conn, live) def tdummyflow(client_conn=True, server_conn=True, err=None): diff --git a/test/netlib/http/http1/test_assemble.py b/test/netlib/http/http1/test_assemble.py index 841ea58a..5d7e007e 100644 --- a/test/netlib/http/http1/test_assemble.py +++ b/test/netlib/http/http1/test_assemble.py @@ -1,4 +1,3 @@ -from __future__ import absolute_import, print_function, division from netlib.exceptions import HttpException from netlib.http import Headers from netlib.http.http1.assemble import ( diff --git a/test/netlib/http/http1/test_read.py b/test/netlib/http/http1/test_read.py index 44eff2ee..86480e2b 100644 --- a/test/netlib/http/http1/test_read.py +++ b/test/netlib/http/http1/test_read.py @@ -1,4 +1,3 @@ -from __future__ import absolute_import, print_function, division from io import BytesIO from mock import Mock @@ -104,7 +103,7 @@ def test_read_response_head(): assert rfile.read() == b"skip" -class TestReadBody(object): +class TestReadBody: def test_chunked(self): rfile = BytesIO(b"3\r\nfoo\r\n0\r\n\r\nbar") body = b"".join(read_body(rfile, None)) @@ -289,7 +288,7 @@ def test_check_http_version(): _check_http_version(b"HTTP/1.b") -class TestReadHeaders(object): +class TestReadHeaders: @staticmethod def _read(data): return _read_headers(BytesIO(data)) diff --git a/test/netlib/http/test_headers.py b/test/netlib/http/test_headers.py index e8752c52..63f16897 100644 --- a/test/netlib/http/test_headers.py +++ b/test/netlib/http/test_headers.py @@ -4,7 +4,7 @@ from netlib.http.headers import Headers, parse_content_type, assemble_content_ty from netlib.tutils import raises -class TestHeaders(object): +class TestHeaders: def _2host(self): return Headers( ( diff --git a/test/netlib/http/test_message.py b/test/netlib/http/test_message.py index 5d533ad7..8374f8f6 100644 --- a/test/netlib/http/test_message.py +++ b/test/netlib/http/test_message.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import, print_function, division from netlib.tutils import tresp from netlib import http, tutils @@ -36,7 +35,7 @@ def _test_decoded_attr(message, attr): assert getattr(message.data, attr) == b"FOO\xBF\x00BAR" -class TestMessageData(object): +class TestMessageData: def test_eq_ne(self): data = tresp(timestamp_start=42, timestamp_end=42).data same = tresp(timestamp_start=42, timestamp_end=42).data @@ -50,7 +49,7 @@ class TestMessageData(object): assert data != 0 -class TestMessage(object): +class TestMessage: def test_init(self): resp = tresp() @@ -108,7 +107,7 @@ class TestMessage(object): assert r.content == b"ggfootoo" -class TestMessageContentEncoding(object): +class TestMessageContentEncoding: def test_simple(self): r = tresp() assert r.raw_content == b"message" @@ -186,7 +185,7 @@ class TestMessageContentEncoding(object): assert "content-encoding" not in r.headers -class TestMessageText(object): +class TestMessageText: def test_simple(self): r = tresp(content=b'\xfc') assert r.raw_content == b"\xfc" diff --git a/test/netlib/http/test_request.py b/test/netlib/http/test_request.py index 1f01d29d..87eb9c35 100644 --- a/test/netlib/http/test_request.py +++ b/test/netlib/http/test_request.py @@ -1,12 +1,11 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import, print_function, division from netlib.http import Headers from netlib.tutils import treq, raises from .test_message import _test_decoded_attr, _test_passthrough_attr -class TestRequestData(object): +class TestRequestData: def test_init(self): with raises(ValueError): treq(headers="foobar") @@ -14,7 +13,7 @@ class TestRequestData(object): assert isinstance(treq(headers=()).headers, Headers) -class TestRequestCore(object): +class TestRequestCore: """ Tests for builtins and the attributes that are directly proxied from the data structure """ @@ -92,7 +91,7 @@ class TestRequestCore(object): assert request.headers["Host"] == "example.org" -class TestRequestUtils(object): +class TestRequestUtils: """ Tests for additional convenience methods. """ diff --git a/test/netlib/http/test_response.py b/test/netlib/http/test_response.py index e97cc419..bf08e6f2 100644 --- a/test/netlib/http/test_response.py +++ b/test/netlib/http/test_response.py @@ -1,4 +1,3 @@ -from __future__ import absolute_import, print_function, division import email @@ -11,7 +10,7 @@ from netlib.tutils import raises, tresp from .test_message import _test_passthrough_attr, _test_decoded_attr -class TestResponseData(object): +class TestResponseData: def test_init(self): with raises(ValueError): tresp(headers="foobar") @@ -19,7 +18,7 @@ class TestResponseData(object): assert isinstance(tresp(headers=()).headers, Headers) -class TestResponseCore(object): +class TestResponseCore: """ Tests for builtins and the attributes that are directly proxied from the data structure """ @@ -60,7 +59,7 @@ class TestResponseCore(object): _test_decoded_attr(tresp(), "reason") -class TestResponseUtils(object): +class TestResponseUtils: """ Tests for additional convenience methods. """ diff --git a/test/netlib/test_debug.py b/test/netlib/test_debug.py index 4732125b..bdb85c9e 100644 --- a/test/netlib/test_debug.py +++ b/test/netlib/test_debug.py @@ -1,4 +1,3 @@ -from __future__ import (absolute_import, print_function, division) import io from netlib import debug diff --git a/test/netlib/test_multidict.py b/test/netlib/test_multidict.py index 58ae0f98..a9523fd9 100644 --- a/test/netlib/test_multidict.py +++ b/test/netlib/test_multidict.py @@ -2,7 +2,7 @@ from netlib import tutils from netlib.multidict import MultiDict, ImmutableMultiDict, MultiDictView -class _TMulti(object): +class _TMulti: @staticmethod def _kconv(key): return key.lower() @@ -16,7 +16,7 @@ class TImmutableMultiDict(_TMulti, ImmutableMultiDict): pass -class TestMultiDict(object): +class TestMultiDict: @staticmethod def _multi(): return TMultiDict(( @@ -194,7 +194,7 @@ class TestMultiDict(object): assert md == md2 -class TestImmutableMultiDict(object): +class TestImmutableMultiDict: def test_modify(self): md = TImmutableMultiDict() with tutils.raises(TypeError): @@ -224,7 +224,7 @@ class TestImmutableMultiDict(object): assert md.with_insert(0, "foo", "bar").fields == (("foo", "bar"),) -class TParent(object): +class TParent: def __init__(self): self.vals = tuple() @@ -235,7 +235,7 @@ class TParent(object): return self.vals -class TestMultiDictView(object): +class TestMultiDictView: def test_modify(self): p = TParent() tv = MultiDictView(p.getter, p.setter) diff --git a/test/netlib/tservers.py b/test/netlib/tservers.py index 10a6f70a..e24506ee 100644 --- a/test/netlib/tservers.py +++ b/test/netlib/tservers.py @@ -1,4 +1,3 @@ -from __future__ import (absolute_import, print_function, division) import threading import queue @@ -85,7 +84,7 @@ class _TServer(tcp.TCPServer): self.q.put(s.getvalue()) -class ServerTestBase(object): +class ServerTestBase: ssl = None handler = None addr = ("localhost", 0) diff --git a/test/netlib/websockets/test_frame.py b/test/netlib/websockets/test_frame.py index cce39454..a039dcb1 100644 --- a/test/netlib/websockets/test_frame.py +++ b/test/netlib/websockets/test_frame.py @@ -6,7 +6,7 @@ from netlib import websockets from netlib import tutils -class TestFrameHeader(object): +class TestFrameHeader: @pytest.mark.parametrize("input,expected", [ (0, '0100'), @@ -123,7 +123,7 @@ class TestFrameHeader(object): assert f.masking_key -class TestFrame(object): +class TestFrame: def test_equality(self): f = websockets.Frame(payload=b'1234') f2 = websockets.Frame(payload=b'1234') diff --git a/test/netlib/websockets/test_masker.py b/test/netlib/websockets/test_masker.py index 528fce71..23a9b876 100644 --- a/test/netlib/websockets/test_masker.py +++ b/test/netlib/websockets/test_masker.py @@ -4,7 +4,7 @@ import pytest from netlib import websockets -class TestMasker(object): +class TestMasker: @pytest.mark.parametrize("input,expected", [ ([b"a"], '00'), diff --git a/test/netlib/websockets/test_utils.py b/test/netlib/websockets/test_utils.py index 34765e04..f6f1e40a 100644 --- a/test/netlib/websockets/test_utils.py +++ b/test/netlib/websockets/test_utils.py @@ -4,7 +4,7 @@ from netlib import http from netlib import websockets -class TestUtils(object): +class TestUtils: def test_client_handshake_headers(self): h = websockets.client_handshake_headers(version='42') diff --git a/test/pathod/__init__.py b/test/pathod/__init__.py index 3f5dc124..e69de29b 100644 --- a/test/pathod/__init__.py +++ b/test/pathod/__init__.py @@ -1 +0,0 @@ -from __future__ import (print_function, absolute_import, division) diff --git a/test/pathod/test_language_base.py b/test/pathod/test_language_base.py index 12a235e4..b8abc9ba 100644 --- a/test/pathod/test_language_base.py +++ b/test/pathod/test_language_base.py @@ -343,7 +343,7 @@ def test_unique_name(): assert b.unique_name -class test_boolean(): +class test_boolean: e = TBoolean.expr() assert e.parseString("test")[0].value assert not e.parseString("-test")[0].value diff --git a/test/pathod/test_pathod.py b/test/pathod/test_pathod.py index d119348a..89d7c562 100644 --- a/test/pathod/test_pathod.py +++ b/test/pathod/test_pathod.py @@ -7,7 +7,7 @@ from netlib.exceptions import HttpException, TlsException from . import tutils -class TestPathod(object): +class TestPathod: def test_logging(self): s = io.StringIO() diff --git a/test/pathod/test_protocols_http2.py b/test/pathod/test_protocols_http2.py index 7f65c0eb..7300cc1d 100644 --- a/test/pathod/test_protocols_http2.py +++ b/test/pathod/test_protocols_http2.py @@ -169,7 +169,7 @@ class TestPerformClientConnectionPreface(netlib_tservers.ServerTestBase): assert protocol.connection_preface_performed -class TestClientStreamIds(object): +class TestClientStreamIds: c = tcp.TCPClient(("127.0.0.1", 0)) protocol = HTTP2StateProtocol(c) @@ -183,7 +183,7 @@ class TestClientStreamIds(object): assert self.protocol.current_stream_id == 5 -class TestserverstreamIds(object): +class TestserverstreamIds: c = tcp.TCPClient(("127.0.0.1", 0)) protocol = HTTP2StateProtocol(c, is_server=True) @@ -230,7 +230,7 @@ class TestApplySettings(netlib_tservers.ServerTestBase): hyperframe.frame.SettingsFrame.INITIAL_WINDOW_SIZE] == 'deadbeef' -class TestCreateHeaders(object): +class TestCreateHeaders: c = tcp.TCPClient(("127.0.0.1", 0)) def test_create_headers(self): @@ -267,7 +267,7 @@ class TestCreateHeaders(object): assert bytes[2] == codecs.decode('00000209040000000163d5', 'hex_codec') -class TestCreateBody(object): +class TestCreateBody: c = tcp.TCPClient(("127.0.0.1", 0)) def test_create_body_empty(self): @@ -422,7 +422,7 @@ class TestReadEmptyResponse(netlib_tservers.ServerTestBase): assert resp.content == b'' -class TestAssembleRequest(object): +class TestAssembleRequest: c = tcp.TCPClient(("127.0.0.1", 0)) def test_request_simple(self): @@ -476,7 +476,7 @@ class TestAssembleRequest(object): codecs.decode('000006000100000001666f6f626172', 'hex_codec') -class TestAssembleResponse(object): +class TestAssembleResponse: c = tcp.TCPClient(("127.0.0.1", 0)) def test_simple(self): diff --git a/test/pathod/tutils.py b/test/pathod/tutils.py index 518485ba..c2243578 100644 --- a/test/pathod/tutils.py +++ b/test/pathod/tutils.py @@ -23,7 +23,7 @@ def treader(bytes): return tcp.Reader(fp) -class DaemonTests(object): +class DaemonTests: nohang = False ssl = False timeout = None |