@@ -15,6 +15,8 @@ def setUp(self):
15
15
self .status_501 = f'{ url } /status/501'
16
16
self .basic_url = f'{ url } /get'
17
17
self .html_url = f'{ url } /html'
18
+ self .delayed_url = f'{ url } /delay/10' # 10 Seconds delay response
19
+ self .cookies_url = f"{ url } /cookies/set/test/value"
18
20
19
21
def test_basic_fetch (self ):
20
22
"""Test doing basic fetch request with multiple statuses"""
@@ -35,6 +37,10 @@ def test_waiting_selector(self):
35
37
"""Test if waiting for a selector make page does not finish loading or not"""
36
38
self .assertEqual (self .fetcher .fetch (self .html_url , wait_selector = 'h1' ).status , 200 )
37
39
40
+ def test_cookies_loading (self ):
41
+ """Test if cookies are set after the request"""
42
+ self .assertEqual (self .fetcher .fetch (self .cookies_url ).cookies , {'test' : 'value' })
43
+
38
44
def test_automation (self ):
39
45
"""Test if automation break the code or not"""
40
46
def scroll_page (page ):
@@ -53,4 +59,4 @@ def test_properties(self):
53
59
54
60
def test_infinite_timeout (self ):
55
61
"""Test if infinite timeout breaks the code or not"""
56
- self .assertEqual (self .fetcher .fetch (self .html_url , timeout = None ).status , 200 )
62
+ self .assertEqual (self .fetcher .fetch (self .delayed_url , timeout = None ).status , 200 )
0 commit comments