Skip to content
Snippets Groups Projects
Commit 88d67f9a authored by finn's avatar finn
Browse files

Moved cas tests and moved test of many reads to own function.

Parameter with many reads was spamming the verbose pytest, so moved to own function.
parent 2f3836a0
No related branches found
No related tags found
Loading
Checking pipeline status
File moved
......@@ -70,7 +70,7 @@ def raise_mock_exception(*args, **kwargs):
raise MockException()
test_strings = [b"", b"hij", b"testing!" * 1000000]
test_strings = [b"", b"hij"]
instances = ["", "test_inst"]
......@@ -91,6 +91,24 @@ def test_bytestream_read(data_to_read, instance):
assert data == data_to_read
@pytest.mark.parametrize("instance", instances)
def test_bytestream_read_many(instance):
data_to_read = b"testing" * 10000
storage = SimpleStorage([b"abc", b"defg", data_to_read])
servicer = ByteStreamService(storage)
request = bytestream_pb2.ReadRequest()
if instance != "":
request.resource_name = instance + "/"
request.resource_name += f"blobs/{HASH(data_to_read).hexdigest()}/{len(data_to_read)}"
data = b""
for response in servicer.Read(request, None):
data += response.data
assert data == data_to_read
@pytest.mark.parametrize("instance", instances)
@pytest.mark.parametrize("extra_data", ["", "/", "/extra/data"])
def test_bytestream_write(instance, extra_data):
......
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment