Test normalizing cookie attributes between internal and browser formats.
(session_cookies: SessionCookies)
| 72 | |
| 73 | |
| 74 | def test_convert_dict_format(session_cookies: SessionCookies) -> None: |
| 75 | """Test normalizing cookie attributes between internal and browser formats.""" |
| 76 | internal_format = CookieParam({'name': 'test', 'value': 'value', 'http_only': True, 'same_site': 'Lax'}) |
| 77 | |
| 78 | # Test internal to browser format |
| 79 | browser_format = session_cookies._to_playwright(internal_format) |
| 80 | assert 'httpOnly' in browser_format |
| 81 | assert 'sameSite' in browser_format |
| 82 | assert 'http_only' not in browser_format |
| 83 | assert 'same_site' not in browser_format |
| 84 | |
| 85 | # Test browser to internal format |
| 86 | browser_format = PlaywrightCookieParam({'name': 'test', 'value': 'value', 'httpOnly': True, 'sameSite': 'Lax'}) |
| 87 | internal_format = session_cookies._from_playwright(browser_format) |
| 88 | assert 'http_only' in internal_format |
| 89 | assert 'same_site' in internal_format |
| 90 | assert 'httpOnly' not in internal_format |
| 91 | assert 'sameSite' not in internal_format |
| 92 | |
| 93 | |
| 94 | def test_get_cookies_as_browser_format(session_cookies: SessionCookies, cookie_dict: CookieParam) -> None: |
nothing calls this directly
no test coverage detected