forked from mlflow/mlflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not raise if error_code is missing from RestException (mlflow#1192)
- Loading branch information
1 parent
4eae317
commit cbc9c9e
Showing
2 changed files
with
14 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
from mlflow.exceptions import ExecutionException | ||
from mlflow.exceptions import ExecutionException, RestException | ||
|
||
|
||
def test_execution_exception_string_repr(): | ||
exc = ExecutionException("Uh oh") | ||
assert str(exc) == "Uh oh" | ||
|
||
|
||
def test_rest_exception_default_error_code(): | ||
exc = RestException({"message": "something important."}) | ||
assert "something important." in str(exc) | ||
|
||
|
||
def test_rest_exception_error_code_is_not_none(): | ||
error_string = "something important." | ||
exc = RestException({"message": error_string}) | ||
assert "None" not in error_string | ||
assert "None" not in str(exc) |