MCPcopy
hub / github.com/python/mypy / test_isfile_case_1

Method test_isfile_case_1

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

Source from the content-addressed store, hash-verified

22 shutil.rmtree(self.tempdir)
23
24 def test_isfile_case_1(self) -> None:
25 self.make_file("bar.py")
26 self.make_file("pkg/sub_package/__init__.py")
27 self.make_file("pkg/sub_package/foo.py")
28 # Run twice to test both cached and non-cached code paths.
29 for i in range(2):
30 assert self.isfile_case("bar.py")
31 assert self.isfile_case("pkg/sub_package/__init__.py")
32 assert self.isfile_case("pkg/sub_package/foo.py")
33 assert not self.isfile_case("non_existent.py")
34 assert not self.isfile_case("pkg/non_existent.py")
35 assert not self.isfile_case("pkg/")
36 assert not self.isfile_case("bar.py/")
37 for i in range(2):
38 assert not self.isfile_case("Bar.py")
39 assert not self.isfile_case("pkg/sub_package/__init__.PY")
40 assert not self.isfile_case("pkg/Sub_Package/foo.py")
41 assert not self.isfile_case("Pkg/sub_package/foo.py")
42
43 def test_isfile_case_2(self) -> None:
44 self.make_file("bar.py")

Callers

nothing calls this directly

Calls 3

make_fileMethod · 0.95
isfile_caseMethod · 0.95
rangeClass · 0.85

Tested by

no test coverage detected