コード例 #1
0
def test_rest_exception():
    mlflow_exception = MlflowException("test",
                                       error_code=RESOURCE_ALREADY_EXISTS)
    json_exception = mlflow_exception.serialize_as_json()
    deserialized_rest_exception = RestException(json.loads(json_exception))
    assert deserialized_rest_exception.error_code == "RESOURCE_ALREADY_EXISTS"
    assert "test" in deserialized_rest_exception.message
コード例 #2
0
ファイル: test_exceptions.py プロジェクト: zwd1990/mlflow
 def test_serialize_to_json(self):
     mlflow_exception = MlflowException("test")
     deserialized = json.loads(mlflow_exception.serialize_as_json())
     assert deserialized["message"] == "test"
     assert deserialized["error_code"] == "INTERNAL_ERROR"
コード例 #3
0
 def test_serialize_to_json(self):
     mlflow_exception = MlflowException('test')
     deserialized = json.loads(mlflow_exception.serialize_as_json())
     assert deserialized['message'] == 'test'
     assert deserialized['error_code'] == 'INTERNAL_ERROR'