mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
Increased net.http.cookies.py and net.http.message.py coverage
This commit is contained in:
parent
9f8e83259e
commit
766c5caea8
@ -269,6 +269,9 @@ def test_refresh_cookie():
|
|||||||
c = "MOO=BAR; Expires=Tue, 08-Mar-2011 00:20:38 GMT; Path=foo.com; Secure"
|
c = "MOO=BAR; Expires=Tue, 08-Mar-2011 00:20:38 GMT; Path=foo.com; Secure"
|
||||||
assert "00:21:38" in cookies.refresh_set_cookie_header(c, 60)
|
assert "00:21:38" in cookies.refresh_set_cookie_header(c, 60)
|
||||||
|
|
||||||
|
c = "rfoo=bar; Domain=reddit.com; expires=Thu, 31 Dec 2037; Path=/"
|
||||||
|
assert "expires" not in cookies.refresh_set_cookie_header(c, 60)
|
||||||
|
|
||||||
c = "foo,bar"
|
c = "foo,bar"
|
||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
cookies.refresh_set_cookie_header(c, 60)
|
cookies.refresh_set_cookie_header(c, 60)
|
||||||
|
@ -48,6 +48,12 @@ class TestMessageData:
|
|||||||
|
|
||||||
assert data != 0
|
assert data != 0
|
||||||
|
|
||||||
|
def test_serializable(self):
|
||||||
|
data1 = tutils.tresp(timestamp_start=42, timestamp_end=42).data
|
||||||
|
data2 = tutils.tresp().data.from_state(data1.get_state()) # ResponseData.from_state()
|
||||||
|
|
||||||
|
assert data1 == data2
|
||||||
|
|
||||||
|
|
||||||
class TestMessage:
|
class TestMessage:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user