Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions test/integration/test_groundlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,13 +689,15 @@ def test_ask_method_quality(gl: Groundlight, detector: Detector):
assert confident_iq.result.confidence is None or (confident_iq.result.confidence > IQ_IMPROVEMENT_THRESHOLD)


@pytest.mark.skip_for_edge_endpoint(reason="The edge-endpoint doesn't support inspection_id")
def test_start_inspection(gl: Groundlight):
inspection_id = gl.start_inspection()

assert isinstance(inspection_id, str)
assert "inspect_" in inspection_id


@pytest.mark.skip_for_edge_endpoint(reason="The edge-endpoint doesn't support inspection_id")
def test_update_inspection_metadata_success(gl: Groundlight):
"""Starts an inspection and adds a couple pieces of metadata to it.
This should succeed. If there are any errors, an exception will be raised.
Expand All @@ -711,6 +713,7 @@ def test_update_inspection_metadata_success(gl: Groundlight):
gl.update_inspection_metadata(inspection_id, user_provided_key, user_provided_value)


@pytest.mark.skip_for_edge_endpoint(reason="The edge-endpoint doesn't support inspection_id")
def test_update_inspection_metadata_failure(gl: Groundlight):
"""Attempts to add metadata to an inspection after it is closed.
Should raise an exception.
Expand All @@ -725,6 +728,7 @@ def test_update_inspection_metadata_failure(gl: Groundlight):
gl.update_inspection_metadata(inspection_id, user_provided_key, user_provided_value)


@pytest.mark.skip_for_edge_endpoint(reason="The edge-endpoint doesn't support inspection_id")
def test_update_inspection_metadata_invalid_inspection_id(gl: Groundlight):
"""Attempt to update metadata for an inspection that doesn't exist.
Should raise an InternalApiError.
Expand All @@ -738,6 +742,7 @@ def test_update_inspection_metadata_invalid_inspection_id(gl: Groundlight):
gl.update_inspection_metadata(inspection_id, user_provided_key, user_provided_value)


@pytest.mark.skip_for_edge_endpoint(reason="The edge-endpoint doesn't support inspection_id")
def test_stop_inspection_pass(gl: Groundlight, detector: Detector):
"""Starts an inspection, submits a query with the inspection ID that should pass, stops
the inspection, checks the result.
Expand All @@ -749,6 +754,7 @@ def test_stop_inspection_pass(gl: Groundlight, detector: Detector):
assert gl.stop_inspection(inspection_id) == "PASS"


@pytest.mark.skip_for_edge_endpoint(reason="The edge-endpoint doesn't support inspection_id")
def test_stop_inspection_fail(gl: Groundlight, detector: Detector):
"""Starts an inspection, submits a query that should fail, stops
the inspection, checks the result.
Expand All @@ -761,6 +767,7 @@ def test_stop_inspection_fail(gl: Groundlight, detector: Detector):
assert gl.stop_inspection(inspection_id) == "FAIL"


@pytest.mark.skip_for_edge_endpoint(reason="The edge-endpoint doesn't support inspection_id")
def test_stop_inspection_with_invalid_id(gl: Groundlight):
inspection_id = "some_invalid_inspection_id"

Expand Down