Increased net.http.cookies.py and net.http.message.py coverage

This commit is contained in:
Ujjwal Verma 2017-05-09 18:42:05 +05:30
parent 9f8e83259e
commit 766c5caea8
2 changed files with 9 additions and 0 deletions

View File

@ -269,6 +269,9 @@ def test_refresh_cookie():
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)
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"
with pytest.raises(ValueError):
cookies.refresh_set_cookie_header(c, 60)

View File

@ -48,6 +48,12 @@ class TestMessageData:
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: