MCPcopy Index your code
hub / github.com/python/mypy / test_isfile_case_other_directory

Method test_isfile_case_other_directory

mypy/test/testfscache.py:77–88  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

75 assert self.isfile_case("pkg/sub_package/foo.py")
76
77 def test_isfile_case_other_directory(self) -> None:
78 self.make_file("bar.py")
79 with tempfile.TemporaryDirectory() as other:
80 self.make_file("other_dir.py", base=other)
81 self.make_file("pkg/other_dir.py", base=other)
82 assert self.isfile_case(os.path.join(other, "other_dir.py"))
83 assert not self.isfile_case(os.path.join(other, "Other_Dir.py"))
84 assert not self.isfile_case(os.path.join(other, "bar.py"))
85 if os.path.exists(os.path.join(other, "PKG/other_dir.py")):
86 # We only check case for directories under our prefix, and since
87 # this path is not under the prefix, case difference is fine.
88 assert self.isfile_case(os.path.join(other, "PKG/other_dir.py"))
89
90 def make_file(self, path: str, base: str | None = None) -> None:
91 if base is None:

Callers

nothing calls this directly

Calls 4

make_fileMethod · 0.95
isfile_caseMethod · 0.95
existsMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected