Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
Signed-off-by: kalyan <[email protected]>
  • Loading branch information
rawwar committed Oct 12, 2023
1 parent 1fca8ca commit 0338bd8
Showing 1 changed file with 35 additions and 13 deletions.
48 changes: 35 additions & 13 deletions tests/ml_commons/test_ml_commons_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ def test_integration_pretrained_model_register_undeploy_delete():
except Exception as ex: # noqa: E722
raised = True
exception_message = str(ex)
assert raised == False, "Raised Exception in getting pretrained model info. Exception: {exception_message}"
assert (
raised == False
), "Raised Exception in getting pretrained model info. Exception: {exception_message}"

raised = False
try:
Expand All @@ -290,7 +292,9 @@ def test_integration_pretrained_model_register_undeploy_delete():
except Exception as ex: # noqa: E722
raised = True
exception_message = str(ex)
assert raised == False, "Raised Exception in pretrained model undeployment. Exception: {exception_message}"
assert (
raised == False
), "Raised Exception in pretrained model undeployment. Exception: {exception_message}"

raised = False
try:
Expand All @@ -299,7 +303,9 @@ def test_integration_pretrained_model_register_undeploy_delete():
except Exception as ex: # noqa: E722
raised = True
exception_message = str(ex)
assert raised == False, "Raised Exception in deleting pretrained model. Exception: {exception_message}"
assert (
raised == False
), "Raised Exception in deleting pretrained model. Exception: {exception_message}"


def test_DEPRECATED_integration_model_train_upload_full_cycle():
Expand Down Expand Up @@ -437,7 +443,9 @@ def test_integration_model_train_register_full_cycle():
except Exception as ex: # noqa: E722
raised = True
exception_message = str(ex)
assert raised == False, f"Raised Exception during first model registration. Exception: {exception_message}"
assert (
raised == False
), f"Raised Exception during first model registration. Exception: {exception_message}"

raised = False
try:
Expand All @@ -451,7 +459,9 @@ def test_integration_model_train_register_full_cycle():
except Exception as ex: # noqa: E722
raised = True
exception_message = str(ex)
assert raised == False, f"Raised Exception during second model registration. Exception: {exception_message}"
assert (
raised == False
), f"Raised Exception during second model registration. Exception: {exception_message}"

if model_id:
raised = False
Expand All @@ -467,7 +477,9 @@ def test_integration_model_train_register_full_cycle():
except Exception as ex: # noqa: E722
raised = True
exception_message = str(ex)
assert raised == False, f"Raised Exception in model deployment. Exception: {exception_message}"
assert (
raised == False
), f"Raised Exception in model deployment. Exception: {exception_message}"

raised = False
try:
Expand All @@ -477,7 +489,9 @@ def test_integration_model_train_register_full_cycle():
except Exception as ex: # noqa: E722
raised = True
exception_message = str(ex)
assert raised == False, f"Raised Exception in getting model info. Exception: {exception_message}"
assert (
raised == False
), f"Raised Exception in getting model info. Exception: {exception_message}"

if task_id:
raised = False
Expand All @@ -493,7 +507,9 @@ def test_integration_model_train_register_full_cycle():
print("Model Task Status:", ml_task_status)
raised = True
exception_message = str(ex)
assert raised == False, f"Raised Exception in pulling task info. Exception: {exception_message}"
assert (
raised == False
), f"Raised Exception in pulling task info. Exception: {exception_message}"

# This is test is being flaky. Sometimes the test is passing and sometimes showing 500 error
# due to memory circuit breaker.
Expand All @@ -509,24 +525,28 @@ def test_integration_model_train_register_full_cycle():
exception_message = str(ex)
assert (
raised == False
),f"Raised Exception in generating sentence embedding. Exception: {exception_message}"
), f"Raised Exception in generating sentence embedding. Exception: {exception_message}"

try:
delete_task_obj = ml_client.delete_task(task_id)
assert delete_task_obj.get("result") == "deleted"
except Exception as ex: # noqa: E722
raised = True
exception_message = str(ex)
assert raised == False, f"Raised Exception in deleting task. Exception: {exception_message}"
assert (
raised == False
), f"Raised Exception in deleting task. Exception: {exception_message}"

try:
ml_client.undeploy_model(model_id)
ml_model_status = ml_client.get_model_info(model_id)
assert ml_model_status.get("model_state") != "UNDEPLOY_FAILED"
except Exception as ex: # noqa: E722
raised =
raised = True
exception_message = str(ex)
assert raised == False, f"Raised Exception in model undeployment. Exception: {exception_message}"
assert (
raised == False
), f"Raised Exception in model undeployment. Exception: {exception_message}"

raised = False
try:
Expand All @@ -535,7 +555,9 @@ def test_integration_model_train_register_full_cycle():
except Exception as ex: # noqa: E722
raised = True
exception_message = str(ex)
assert raised == False, f"Raised Exception in deleting model. Exception: {exception_message}"
assert (
raised == False
), f"Raised Exception in deleting model. Exception: {exception_message}"


test_integration_model_train_register_full_cycle()

0 comments on commit 0338bd8

Please sign in to comment.