Skip to content

Commit

Permalink
removing redundant testing
Browse files Browse the repository at this point in the history
  • Loading branch information
KrishnanPrash committed Dec 13, 2024
1 parent 17c2831 commit abf7407
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions qa/L0_python_api/test_kserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
RestrictedFeatures,
)

# To test a class individually, user pytest test_kserve.py -k "<ClassName>"


class TestHttpOptions:
def test_correct_http_parameters(self):
Expand Down Expand Up @@ -135,14 +133,11 @@ def test_correct_parameters(self):

rf.remove_feature_group(correct_feature_group)

assert not rf.has_feature(Feature.HEALTH) and not rf.has_feature(Feature.METADATA)
assert not rf.has_feature(Feature.HEALTH) and not rf.has_feature(
Feature.METADATA
)

def test_wrong_rf_parameters(self):
with pytest.raises(AttributeError):
Feature.health # Needs to be HEALTH
with pytest.raises(AttributeError):
Feature.infer # Needs to be INFERENCE

rf = RestrictedFeatures()
# Features List needs to be an element from tritonfrontend.Feature
with pytest.raises(tritonserver.InvalidArgumentError):
Expand All @@ -157,21 +152,18 @@ def test_wrong_rf_parameters(self):
rf.create_feature_group(key="", value=123, features=[Feature.HEALTH])

# Test collision of Features among individual Feature Groups
with pytest.raises(tritonserver.InvalidArgumentError):
with pytest.raises(
tritonserver.InvalidArgumentError,
match="A given feature can only belong to one "
"group.Feature.HEALTH already belongs to an existing group.",
):
feature_group = FeatureGroup(
key="key", value="val", features=[Feature.METADATA, Feature.HEALTH]
)

rf = RestrictedFeatures(groups=[feature_group])
rf.create_feature_group(key="key2", value="val", features=[Feature.HEALTH])

with pytest.raises(tritonserver.InvalidArgumentError):
rf = RestrictedFeatures(groups=[feature_group])
rf.create_feature_group(
key="key", value="val", features=[Feature.METADATA, Feature.HEALTH]
)
rf.create_feature_group(key="key2", value="val", features=[Feature.HEALTH])


HTTP_ARGS = (KServeHttp, httpclient, "localhost:8000") # Default HTTP args
GRPC_ARGS = (KServeGrpc, grpcclient, "localhost:8001") # Default GRPC args
Expand Down

0 comments on commit abf7407

Please sign in to comment.