Skip to content

Commit

Permalink
changes in test cases because of commit 88bea36 to fix SeldonIO#703
Browse files Browse the repository at this point in the history
  • Loading branch information
lkuma37 committed Aug 3, 2019
1 parent 5f53e8a commit f2d9a5a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/tests/test_model_microservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,18 @@ class UserObjectLowLevelWithPredictRaw(SeldonComponent):
def __init__(self, check_name):
self.check_name=check_name
def predict_raw(self, msg):
msg=json_to_seldon_message(msg)
if self.check_name == 'img':
file_data=msg.binData
img = Image.open(io.BytesIO (file_data))
img.verify()
return json_to_seldon_message({"meta": seldon_message_to_json(msg.meta),"data": {"ndarray": [rs232_checksum(file_data).decode('utf-8')]}})
return {"meta": seldon_message_to_json(msg.meta),"data": {"ndarray": [rs232_checksum(file_data).decode('utf-8')]}}
elif self.check_name == 'txt':
file_data=msg.binData
return json_to_seldon_message({"meta": seldon_message_to_json(msg.meta),"data": {"ndarray": [file_data.decode('utf-8')]}})
return {"meta": seldon_message_to_json(msg.meta),"data": {"ndarray": [file_data.decode('utf-8')]}}
elif self.check_name == 'strData':
file_data=msg.strData
return json_to_seldon_message({"meta": seldon_message_to_json(msg.meta), "data": {"ndarray": [file_data]}})
return {"meta": seldon_message_to_json(msg.meta), "data": {"ndarray": [file_data]}}


class UserObjectLowLevelGrpc(SeldonComponent):
Expand Down Expand Up @@ -152,7 +153,6 @@ def test_model_ok():
assert j["data"]["names"] == ["t:0", "t:1"]
assert j["data"]["ndarray"] == [[1.0, 2.0]]


def test_model_lowlevel_ok():
user_object = UserObjectLowLevel()
app = get_rest_microservice(user_object)
Expand Down

0 comments on commit f2d9a5a

Please sign in to comment.