(self)
| 2219 | assert "../../../tmp/pwned" not in mode.get_cache_key() |
| 2220 | |
| 2221 | def test_cache_broken_file(self) -> None: |
| 2222 | mode = DEFAULT_MODE |
| 2223 | with cache_dir() as workspace: |
| 2224 | cache_file = get_cache_file(mode) |
| 2225 | cache_file.write_text("this is not a pickle", encoding="utf-8") |
| 2226 | assert black.Cache.read(mode).file_data == {} |
| 2227 | src = (workspace / "test.py").resolve() |
| 2228 | src.write_text("print('hello')", encoding="utf-8") |
| 2229 | invokeBlack([str(src)]) |
| 2230 | cache = black.Cache.read(mode) |
| 2231 | assert not cache.is_changed(src) |
| 2232 | |
| 2233 | def test_cache_single_file_already_cached(self) -> None: |
| 2234 | mode = DEFAULT_MODE |
nothing calls this directly
no test coverage detected