Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: kalyanr <[email protected]>
  • Loading branch information
rawwar committed Dec 7, 2023
1 parent dbd776c commit bc941fa
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tests/ml_commons/test_ml_commons_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ def test_search():
# Model Profile Tests. These will need some model train/predict data. Hence, need to be
# at the end after the training/prediction tests are done.

@pytest.fixture
def profile_client():
client = ModelProfile(OPENSEARCH_TEST_CLIENT)
return client
Expand All @@ -596,25 +597,31 @@ def test_get_profile(profile_client):
def test_get_models_profile(profile_client):

with pytest.raises(ValueError):
profile_client.get_models_profile("")
profile_client.get_models_profile(10)

with pytest.raises(ValueError):
profile_client.get_models_profile("", 10)

result = profile_client.get_models_profile()
assert isinstance(result, dict)
if len(result) > 0:
assert "nodes" in result
for _, node_val in result['nodes']:
for _, node_val in result['nodes'].items():
assert "models" in node_val



def test_get_tasks_profile(profile_client):

with pytest.raises(ValueError):
profile_client.get_tasks_profile("")
profile_client.get_tasks_profile(10)

with pytest.raises(ValueError):
profile_client.get_tasks_profile("", 10)

result = profile_client.get_tasks_profile()
if len(result) > 0:
assert "nodes" in result
for _, node_val in result['nodes']:
for _, node_val in result['nodes'].items():
assert "tasks" in node_val

0 comments on commit bc941fa

Please sign in to comment.