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

Method test_read_cache_line_lengths

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

Source from the content-addressed store, hash-verified

2468 cache.write([])
2469
2470 def test_read_cache_line_lengths(self) -> None:
2471 mode = DEFAULT_MODE
2472 short_mode = replace(DEFAULT_MODE, line_length=1)
2473 with cache_dir() as workspace:
2474 path = (workspace / "file.py").resolve()
2475 path.touch()
2476 cache = black.Cache.read(mode)
2477 cache.write([path])
2478 one = black.Cache.read(mode)
2479 assert not one.is_changed(path)
2480 two = black.Cache.read(short_mode)
2481 assert two.is_changed(path)
2482
2483 def test_cache_key(self) -> None:
2484 # Test that all members of the mode enum affect the cache key.

Callers

nothing calls this directly

Calls 5

replaceFunction · 0.85
cache_dirFunction · 0.85
readMethod · 0.80
writeMethod · 0.80
is_changedMethod · 0.80

Tested by

no test coverage detected