Home / Class/ TestLookupDict Class — requests Architecture

TestLookupDict Class — requests Architecture

Architecture documentation for the TestLookupDict class in test_structures.py from the requests codebase.

Entity Profile

Dependency Diagram

graph TD
  ac7356c2_7e78_93ea_6fea_e6ab805c4af6["TestLookupDict"]
  733a3397_4d8b_4610_9dd6_21f99211b86c["test_structures.py"]
  ac7356c2_7e78_93ea_6fea_e6ab805c4af6 -->|defined in| 733a3397_4d8b_4610_9dd6_21f99211b86c
  e4c47983_6b91_ae0e_544f_75dc2f77b6c6["setup()"]
  ac7356c2_7e78_93ea_6fea_e6ab805c4af6 -->|method| e4c47983_6b91_ae0e_544f_75dc2f77b6c6
  dcd37945_2e13_6489_2c19_7486fb16d4f2["test_repr()"]
  ac7356c2_7e78_93ea_6fea_e6ab805c4af6 -->|method| dcd37945_2e13_6489_2c19_7486fb16d4f2
  e1cc9674_6246_7c5c_42be_c03534147951["test_getitem()"]
  ac7356c2_7e78_93ea_6fea_e6ab805c4af6 -->|method| e1cc9674_6246_7c5c_42be_c03534147951
  62195e35_ad9d_f606_392b_3c6c4a4d4d98["test_get()"]
  ac7356c2_7e78_93ea_6fea_e6ab805c4af6 -->|method| 62195e35_ad9d_f606_392b_3c6c4a4d4d98

Relationship Graph

Source Code

tests/test_structures.py lines 54–78

class TestLookupDict:
    @pytest.fixture(autouse=True)
    def setup(self):
        """LookupDict instance with "bad_gateway" attribute."""
        self.lookup_dict = LookupDict("test")
        self.lookup_dict.bad_gateway = 502

    def test_repr(self):
        assert repr(self.lookup_dict) == "<lookup 'test'>"

    get_item_parameters = pytest.mark.parametrize(
        "key, value",
        (
            ("bad_gateway", 502),
            ("not_a_key", None),
        ),
    )

    @get_item_parameters
    def test_getitem(self, key, value):
        assert self.lookup_dict[key] == value

    @get_item_parameters
    def test_get(self, key, value):
        assert self.lookup_dict.get(key) == value

Frequently Asked Questions

What is the TestLookupDict class?
TestLookupDict is a class in the requests codebase, defined in tests/test_structures.py.
Where is TestLookupDict defined?
TestLookupDict is defined in tests/test_structures.py at line 54.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free