add size test
MODIFY
pangeo_forge/storage.py
pangeo_forge/storage.py
@@ -124,6 +124,9 @@ class UninitializedTarget(AbstractTarget):
def open(self, path: str, **kwargs): # don't know how to type hint this
raise UninitializedTargetError
+ def size(self, path: str, **kwargs):
+ raise UninitializedTargetError
+
class TargetError(Exception):
"""Base class for exceptions in this module."""

MODIFY
tests/test_fixtures.py
tests/test_fixtures.py
@@ -61,6 +61,7 @@ def test_cache(tmp_cache):
with tmp_cache.open("foo", mode="w") as f:
f.write("bar")
assert tmp_cache.exists("foo")
+ assert tmp_cache.size("foo") == 3
with tmp_cache.open("foo", mode="r") as f:
assert f.read() == "bar"
tmp_cache.rm("foo")

add size test