MCPcopy
hub / github.com/django/django / assertFileFound

Method assertFileFound

tests/utils_tests/test_autoreload.py:39–52  ·  view source on GitHub ↗
(self, filename)

Source from the content-addressed store, hash-verified

37 autoreload.iter_modules_and_files.cache_clear()
38
39 def assertFileFound(self, filename):
40 # Some temp directories are symlinks. Python resolves these fully while
41 # importing.
42 resolved_filename = filename.resolve(strict=True)
43 self.clear_autoreload_caches()
44 # Test uncached access
45 self.assertIn(
46 resolved_filename, list(autoreload.iter_all_python_module_files())
47 )
48 # Test cached access
49 self.assertIn(
50 resolved_filename, list(autoreload.iter_all_python_module_files())
51 )
52 self.assertEqual(autoreload.iter_modules_and_files.cache_info().hits, 1)
53
54 def assertFileNotFound(self, filename):
55 resolved_filename = filename.resolve(strict=True)

Calls 2

resolveMethod · 0.45

Tested by

no test coverage detected