Home / Class/ TestExtractZippedPaths Class — requests Architecture

TestExtractZippedPaths Class — requests Architecture

Architecture documentation for the TestExtractZippedPaths class in test_utils.py from the requests codebase.

Entity Profile

Dependency Diagram

graph TD
  f07cd632_c107_10e3_2ac7_ed3a206fb72f["TestExtractZippedPaths"]
  5828793e_be5b_8952_37f1_338fd4634a1a["test_utils.py"]
  f07cd632_c107_10e3_2ac7_ed3a206fb72f -->|defined in| 5828793e_be5b_8952_37f1_338fd4634a1a
  18e4333e_109d_e4a7_4cb2_40568563020e["test_unzipped_paths_unchanged()"]
  f07cd632_c107_10e3_2ac7_ed3a206fb72f -->|method| 18e4333e_109d_e4a7_4cb2_40568563020e
  374ab4e7_9992_78e3_98ab_b1f3ecc5e81e["test_zipped_paths_extracted()"]
  f07cd632_c107_10e3_2ac7_ed3a206fb72f -->|method| 374ab4e7_9992_78e3_98ab_b1f3ecc5e81e
  dfa91b30_9541_9df5_69ca_2597a60d99b5["test_invalid_unc_path()"]
  f07cd632_c107_10e3_2ac7_ed3a206fb72f -->|method| dfa91b30_9541_9df5_69ca_2597a60d99b5

Relationship Graph

Source Code

tests/test_utils.py lines 332–360

class TestExtractZippedPaths:
    @pytest.mark.parametrize(
        "path",
        (
            "/",
            __file__,
            pytest.__file__,
            "/etc/invalid/location",
        ),
    )
    def test_unzipped_paths_unchanged(self, path):
        assert path == extract_zipped_paths(path)

    def test_zipped_paths_extracted(self, tmpdir):
        zipped_py = tmpdir.join("test.zip")
        with zipfile.ZipFile(zipped_py.strpath, "w") as f:
            f.write(__file__)

        _, name = os.path.splitdrive(__file__)
        zipped_path = os.path.join(zipped_py.strpath, name.lstrip(r"\/"))
        extracted_path = extract_zipped_paths(zipped_path)

        assert extracted_path != zipped_path
        assert os.path.exists(extracted_path)
        assert filecmp.cmp(extracted_path, __file__)

    def test_invalid_unc_path(self):
        path = r"\\localhost\invalid\location"
        assert extract_zipped_paths(path) == path

Domain

Defined In

Frequently Asked Questions

What is the TestExtractZippedPaths class?
TestExtractZippedPaths is a class in the requests codebase, defined in tests/test_utils.py.
Where is TestExtractZippedPaths defined?
TestExtractZippedPaths is defined in tests/test_utils.py at line 332.

Analyze Your Own Codebase

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

Try Supermodel Free