def test_filter_cached(self) -> None: with TemporaryDirectory() as workspace: path = Path(workspace) uncached = (path / "uncached").resolve() cached = (path / "cached").resolve() cached_but_changed = (path / "changed").resolve() uncached.touch() cached.touch() cached_but_changed.touch() cache = {cached: black.get_cache_info(cached), cached_but_changed: (0.0, 0)} todo, done = black.filter_cached( cache, [uncached, cached, cached_but_changed] ) self.assertEqual(todo, [uncached, cached_but_changed]) self.assertEqual(done, [cached])
def test_filter_cached(self) -> None: with TemporaryDirectory() as workspace: path = Path(workspace) uncached = (path / "uncached").resolve() cached = (path / "cached").resolve() cached_but_changed = (path / "changed").resolve() uncached.touch() cached.touch() cached_but_changed.touch() cache = {cached: black.get_cache_info(cached), cached_but_changed: (0.0, 0)} todo, done = black.filter_cached( cache, [uncached, cached, cached_but_changed] ) self.assertEqual(todo, [uncached, cached_but_changed]) self.assertEqual(done, [cached])