TestMorselToCookieExpires Class — requests Architecture
Architecture documentation for the TestMorselToCookieExpires class in test_requests.py from the requests codebase.
Entity Profile
Dependency Diagram
graph TD 94658b92_5836_b58c_d7f2_88ecf129beb7["TestMorselToCookieExpires"] 69ebfd6f_8f0c_4586_0c19_2c348e1a42a2["test_requests.py"] 94658b92_5836_b58c_d7f2_88ecf129beb7 -->|defined in| 69ebfd6f_8f0c_4586_0c19_2c348e1a42a2 d594f6b7_e8d9_99bc_058f_550f32413794["test_expires_valid_str()"] 94658b92_5836_b58c_d7f2_88ecf129beb7 -->|method| d594f6b7_e8d9_99bc_058f_550f32413794 7e82e57f_530c_ca00_930c_8063dd7925f4["test_expires_invalid_int()"] 94658b92_5836_b58c_d7f2_88ecf129beb7 -->|method| 7e82e57f_530c_ca00_930c_8063dd7925f4 d1ae0ca1_b3f2_b445_678b_41a913868906["test_expires_none()"] 94658b92_5836_b58c_d7f2_88ecf129beb7 -->|method| d1ae0ca1_b3f2_b445_678b_41a913868906
Relationship Graph
Source Code
tests/test_requests.py lines 2428–2459
class TestMorselToCookieExpires:
"""Tests for morsel_to_cookie when morsel contains expires."""
def test_expires_valid_str(self):
"""Test case where we convert expires from string time."""
morsel = Morsel()
morsel["expires"] = "Thu, 01-Jan-1970 00:00:01 GMT"
cookie = morsel_to_cookie(morsel)
assert cookie.expires == 1
@pytest.mark.parametrize(
"value, exception",
(
(100, TypeError),
("woops", ValueError),
),
)
def test_expires_invalid_int(self, value, exception):
"""Test case where an invalid type is passed for expires."""
morsel = Morsel()
morsel["expires"] = value
with pytest.raises(exception):
morsel_to_cookie(morsel)
def test_expires_none(self):
"""Test case where expires is None."""
morsel = Morsel()
morsel["expires"] = None
cookie = morsel_to_cookie(morsel)
assert cookie.expires is None
Domain
Defined In
Source
Frequently Asked Questions
What is the TestMorselToCookieExpires class?
TestMorselToCookieExpires is a class in the requests codebase, defined in tests/test_requests.py.
Where is TestMorselToCookieExpires defined?
TestMorselToCookieExpires is defined in tests/test_requests.py at line 2428.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free