Skip to content

Commit

Permalink
Updated tests: changed from MALFORMED request to BAD_REQUEST
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Batomunkuev <abatomunkuev@myseneca.ca>
  • Loading branch information
abatomunkuev committed Nov 22, 2021
1 parent 18e0d2c commit 0a549e3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/pyfunc/test_scoring_server.py
Expand Up @@ -15,7 +15,7 @@
import mlflow.pyfunc.scoring_server as pyfunc_scoring_server
import mlflow.sklearn
from mlflow.models import ModelSignature, infer_signature
from mlflow.protos.databricks_pb2 import ErrorCode, MALFORMED_REQUEST, BAD_REQUEST
from mlflow.protos.databricks_pb2 import ErrorCode, BAD_REQUEST
from mlflow.pyfunc import PythonModel
from mlflow.types import Schema, ColSpec, DataType
from mlflow.utils.file_utils import TempDir
Expand Down Expand Up @@ -106,7 +106,7 @@ def test_scoring_server_responds_to_invalid_json_input_with_stacktrace_and_error
)
response_json = json.loads(response.content)
assert "error_code" in response_json
assert response_json["error_code"] == ErrorCode.Name(MALFORMED_REQUEST)
assert response_json["error_code"] == ErrorCode.Name(BAD_REQUEST)
assert "message" in response_json
assert "stack_trace" in response_json

Expand All @@ -118,7 +118,7 @@ def test_scoring_server_responds_to_invalid_json_input_with_stacktrace_and_error
)
response_json = json.loads(response.content)
assert "error_code" in response_json
assert response_json["error_code"] == ErrorCode.Name(MALFORMED_REQUEST)
assert response_json["error_code"] == ErrorCode.Name(BAD_REQUEST)
assert "message" in response_json
assert "stack_trace" in response_json

Expand All @@ -137,7 +137,7 @@ def test_scoring_server_responds_to_malformed_json_input_with_stacktrace_and_err
)
response_json = json.loads(response.content)
assert "error_code" in response_json
assert response_json["error_code"] == ErrorCode.Name(MALFORMED_REQUEST)
assert response_json["error_code"] == ErrorCode.Name(BAD_REQUEST)
assert "message" in response_json
assert "stack_trace" in response_json

Expand All @@ -158,7 +158,7 @@ def test_scoring_server_responds_to_invalid_pandas_input_format_with_stacktrace_
)
response_json = json.loads(response.content)
assert "error_code" in response_json
assert response_json["error_code"] == ErrorCode.Name(MALFORMED_REQUEST)
assert response_json["error_code"] == ErrorCode.Name(BAD_REQUEST)
assert "message" in response_json
assert "stack_trace" in response_json

Expand Down Expand Up @@ -197,7 +197,7 @@ def test_scoring_server_responds_to_invalid_csv_input_with_stacktrace_and_error_
)
response_json = json.loads(response.content)
assert "error_code" in response_json
assert response_json["error_code"] == ErrorCode.Name(MALFORMED_REQUEST)
assert response_json["error_code"] == ErrorCode.Name(BAD_REQUEST)
assert "message" in response_json
assert "stack_trace" in response_json

Expand Down

0 comments on commit 0a549e3

Please sign in to comment.