test(cookies): Adjust cookies unit tests to the new changes
This commit is contained in:
@@ -61,7 +61,8 @@ class TestStealthyFetcher:
|
||||
async def test_cookies_loading(self, fetcher, urls):
|
||||
"""Test if cookies are set after the request"""
|
||||
response = await fetcher.async_fetch(urls["cookies_url"])
|
||||
assert response.cookies == {"test": "value"}
|
||||
cookies = {response.cookies[0]['name']: response.cookies[0]['value']}
|
||||
assert cookies == {"test": "value"}
|
||||
|
||||
async def test_automation(self, fetcher, urls):
|
||||
"""Test if automation break the code or not"""
|
||||
|
||||
@@ -57,7 +57,8 @@ class TestPlayWrightFetcherAsync:
|
||||
async def test_cookies_loading(self, fetcher, urls):
|
||||
"""Test if cookies are set after the request"""
|
||||
response = await fetcher.async_fetch(urls["cookies_url"])
|
||||
assert response.cookies == {"test": "value"}
|
||||
cookies = {response.cookies[0]['name']: response.cookies[0]['value']}
|
||||
assert cookies == {"test": "value"}
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_automation(self, fetcher, urls):
|
||||
|
||||
@@ -51,7 +51,9 @@ class TestStealthyFetcher:
|
||||
|
||||
def test_cookies_loading(self, fetcher):
|
||||
"""Test if cookies are set after the request"""
|
||||
assert fetcher.fetch(self.cookies_url).cookies == {"test": "value"}
|
||||
response = fetcher.fetch(self.cookies_url)
|
||||
cookies = {response.cookies[0]['name']: response.cookies[0]['value']}
|
||||
assert cookies == {"test": "value"}
|
||||
|
||||
def test_automation(self, fetcher):
|
||||
"""Test if automation break the code or not"""
|
||||
|
||||
@@ -51,7 +51,9 @@ class TestPlayWrightFetcher:
|
||||
|
||||
def test_cookies_loading(self, fetcher):
|
||||
"""Test if cookies are set after the request"""
|
||||
assert fetcher.fetch(self.cookies_url).cookies == {"test": "value"}
|
||||
response = fetcher.fetch(self.cookies_url)
|
||||
cookies = {response.cookies[0]['name']: response.cookies[0]['value']}
|
||||
assert cookies == {"test": "value"}
|
||||
|
||||
def test_automation(self, fetcher):
|
||||
"""Test if automation break the code or not"""
|
||||
|
||||
Reference in New Issue
Block a user