From 1836682ed9f7210f1902ee11d37129d5739f99e1 Mon Sep 17 00:00:00 2001 From: kalyanr Date: Thu, 7 Mar 2024 05:27:19 +0530 Subject: [PATCH] fix Signed-off-by: kalyanr --- tests/ml_commons/test_ml_commons_client.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/ml_commons/test_ml_commons_client.py b/tests/ml_commons/test_ml_commons_client.py index 4367c0fb..68cf783b 100644 --- a/tests/ml_commons/test_ml_commons_client.py +++ b/tests/ml_commons/test_ml_commons_client.py @@ -619,6 +619,18 @@ def test_stats(): for k, v in res["nodes"].items(): assert stat_id in v + with pytest.raises(ValueError): + ml_client.get_stats(node_id="invalid", payload={"query": {"match_all": {}}}) + + with pytest.raises(ValueError): + ml_client.get_stats(payload=10) + + with pytest.raises(ValueError): + ml_client.get_stats(node_id=10) + + with pytest.raises(ValueError): + ml_client.get_stats(stat_id=10) + # Model Profile Tests. These tests will need some model train/predict run data. Hence, need # to be run at the end after the training/prediction tests are done.