mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
check len
This commit is contained in:
@@ -185,10 +185,12 @@ def test_lru_cache_len(keys: list[str], expected_len: int):
|
|||||||
|
|
||||||
def test_fifo_cache():
|
def test_fifo_cache():
|
||||||
cache = FIFOCache(4)
|
cache = FIFOCache(4)
|
||||||
|
assert len(cache) == 0
|
||||||
assert not cache
|
assert not cache
|
||||||
assert "foo" not in cache
|
assert "foo" not in cache
|
||||||
cache["foo"] = 1
|
cache["foo"] = 1
|
||||||
assert "foo" in cache
|
assert "foo" in cache
|
||||||
|
assert len(cache) == 1
|
||||||
assert cache
|
assert cache
|
||||||
cache["bar"] = 2
|
cache["bar"] = 2
|
||||||
cache["baz"] = 3
|
cache["baz"] = 3
|
||||||
|
|||||||
Reference in New Issue
Block a user