diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2018-12-02 11:35:22 +0100 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2018-12-02 15:48:20 +0100 |
commit | 2fb2b48a060f53c10958d493415a802c5daf5830 (patch) | |
tree | 72c83c34ecd4335625d8b8cfa9169da7569fd3ae /test | |
parent | 544f859925865fed4c743f5ff4cc944f444c69e2 (diff) | |
download | mitmproxy-2fb2b48a060f53c10958d493415a802c5daf5830.tar.gz mitmproxy-2fb2b48a060f53c10958d493415a802c5daf5830.tar.bz2 mitmproxy-2fb2b48a060f53c10958d493415a802c5daf5830.zip |
bump dependencies
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/addons/test_readfile.py | 4 | ||||
-rw-r--r-- | test/mitmproxy/net/http/test_headers.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/test_http.py | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/test/mitmproxy/addons/test_readfile.py b/test/mitmproxy/addons/test_readfile.py index 3d28d8b7..94e18cdb 100644 --- a/test/mitmproxy/addons/test_readfile.py +++ b/test/mitmproxy/addons/test_readfile.py @@ -30,8 +30,8 @@ def data(): @pytest.fixture -def corrupt_data(): - f = data() +def corrupt_data(data): + f = io.BytesIO(data.getvalue()) f.seek(0, io.SEEK_END) f.write(b"qibble") f.seek(0) diff --git a/test/mitmproxy/net/http/test_headers.py b/test/mitmproxy/net/http/test_headers.py index e8eb31d3..8fc8b027 100644 --- a/test/mitmproxy/net/http/test_headers.py +++ b/test/mitmproxy/net/http/test_headers.py @@ -75,7 +75,7 @@ class TestHeaders: def test_replace_multi(self): headers = self._2host() - headers.replace(r"Host: example\.com", r"Host: example.de") + headers.replace(r"Host: example.com", r"Host: example.de") assert headers.get_all("Host") == ["example.de", "example.org"] def test_replace_remove_spacer(self): diff --git a/test/mitmproxy/test_http.py b/test/mitmproxy/test_http.py index 49e61e25..8a299d8e 100644 --- a/test/mitmproxy/test_http.py +++ b/test/mitmproxy/test_http.py @@ -49,7 +49,7 @@ class TestHTTPRequest: r.path = "path/foo" r.headers["Foo"] = "fOo" r.content = b"afoob" - assert r.replace("foo(?i)", "boo") == 4 + assert r.replace("(?i)foo", "boo") == 4 assert r.path == "path/boo" assert b"foo" not in r.content assert r.headers["boo"] == "boo" @@ -82,7 +82,7 @@ class TestHTTPResponse: r = http.HTTPResponse.wrap(mitmproxy.test.tutils.tresp()) r.headers["Foo"] = "fOo" r.content = b"afoob" - assert r.replace("foo(?i)", "boo") == 3 + assert r.replace("(?i)foo", "boo") == 3 assert b"foo" not in r.content assert r.headers["boo"] == "boo" |