MCPcopy
hub / github.com/psf/black / test_cache_single_file_already_cached

Method test_cache_single_file_already_cached

tests/test_black.py:2233–2241  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2231 assert not cache.is_changed(src)
2232
2233 def test_cache_single_file_already_cached(self) -> None:
2234 mode = DEFAULT_MODE
2235 with cache_dir() as workspace:
2236 src = (workspace / "test.py").resolve()
2237 src.write_text("print('hello')", encoding="utf-8")
2238 cache = black.Cache.read(mode)
2239 cache.write([src])
2240 invokeBlack([str(src)])
2241 assert src.read_text(encoding="utf-8") == "print('hello')"
2242
2243 @event_loop()
2244 def test_cache_multiple_files(self) -> None:

Callers

nothing calls this directly

Calls 4

cache_dirFunction · 0.85
invokeBlackFunction · 0.85
readMethod · 0.80
writeMethod · 0.80

Tested by

no test coverage detected