Skip to content

Commit

Permalink
redid testing
Browse files Browse the repository at this point in the history
  • Loading branch information
cpavelchek committed Jun 27, 2020
1 parent de78d19 commit 8495e51
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions redis_consumer/consumers/mibi_consumer_test.py
Expand Up @@ -222,26 +222,20 @@ def get_model_metadata(model_name, model_version):

dummyhash = '{}:new.tiff:{}'.format(prefix, status)

model_shapes = [
(-1, 512, 512, 2), # image too small, pad
(-1, 256, 256, 2), # image is exactly the right size
(-1, 128, 128, 2), # image too big, tile
]
model_shape = (-1, 256, 256, 2)

consumer._handle_error = _handle_error
consumer.grpc_image = grpc_image

for model_shape in model_shapes:

consumer.get_model_metadata = \
make_model_metadata_of_size(model_shape)
consumer.get_model_metadata = \
make_model_metadata_of_size(model_shape)

result = consumer._consume(dummyhash)
assert result == consumer.final_status
# test with a finished hash
result = consumer._consume('{}:test.tiff:{}'.format(
prefix, consumer.final_status))
assert result == consumer.final_status
result = consumer._consume(dummyhash)
assert result == consumer.final_status
# test with a finished hash
result = consumer._consume('{}:test.tiff:{}'.format(
prefix, consumer.final_status))
assert result == consumer.final_status

# test with model_name and model_version
redis_client.hgetall = lambda x: {
Expand Down

0 comments on commit 8495e51

Please sign in to comment.