Small refactoring with minor improvements.

This commit is contained in:
2023-11-12 22:28:10 +01:00
parent 67d15f989a
commit 7420d891d4
7 changed files with 139 additions and 75 deletions

View File

@@ -49,7 +49,7 @@ def test_read_write_blob(tmp_dir: Path, repo: Repository):
digest = repo.add_blob(stream)
blob = repo.get_blob(digest)
data = blob.read()
data = blob.reader().read()
with path.open("rb") as stream:
assert data == stream.read()

View File

@@ -55,7 +55,9 @@ def test_simple_cas(tmp_dir: Path):
obj = cas.read(digest)
assert obj is not None
assert obj.digest == digest
assert obj.object_type == b"blob"
assert obj.size == len(data)
assert obj.data == data
cas = SimpleCas(
@@ -68,7 +70,9 @@ def test_simple_cas(tmp_dir: Path):
obj = cas.read(digest)
assert obj is not None
assert obj.digest == digest
assert obj.object_type == b"blob"
assert obj.size == len(data)
assert obj.data == data
digest2 = cas.write(b"blob", data)