Hdf5Sample: Return None for non-existing keys

This commit is contained in:
2021-07-27 10:49:30 -05:00
parent a0f8bf15d6
commit 6c98986675
2 changed files with 13 additions and 0 deletions

View File

@@ -39,6 +39,11 @@ def _test_sample(sample: Sample) -> None:
# Bytes
_assert_roundtrip_bytes(sample, b"\x00\x01\x02\x03\x04\x05")
assert sample.get_scalar("unknown-key") is None
assert sample.get_vector("unknown-key") is None
assert sample.get_vector_list("unknown-key") is None
assert sample.get_bytes("unknown-key") is None
def _assert_roundtrip_bytes(sample: Sample, expected: Any) -> None:
sample.put_bytes("key", expected)