Skip to content

Commit 995210a

Browse files
committed
chore: test ignoring errors
1 parent 9f51f5b commit 995210a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/unit/test_idle_check.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,28 @@ def test_unit_blocked(response: dict[str, Any], kwargs):
213213
assert "small problem" in str(e)
214214

215215

216+
def test_no_raise_on(response: dict[str, Any], kwargs):
217+
app = response["response"]["applications"]["hexanator"]
218+
app["units"]["hexanator/0"]["workload-status"]["status"] = "blocked"
219+
app["units"]["hexanator/0"]["workload-status"]["info"] = "small problem"
220+
app["units"]["hexanator/0"]["machine"] = "42"
221+
response["response"]["machines"] = {
222+
"42": {
223+
"instance-status": {
224+
"status": "running",
225+
"info": "RUNNING",
226+
},
227+
},
228+
}
229+
230+
kwargs["apps"] = ["hexanator"]
231+
kwargs["raise_on_blocked"] = False
232+
kwargs["raise_on_error"] = False
233+
234+
status = check(convert(response), **kwargs)
235+
assert status # didn't raise an exception
236+
237+
216238
def test_maintenance(response: dict[str, Any], kwargs):
217239
"""Taken from nginx-ingress-integrator-operator integration tests."""
218240
app = response["response"]["applications"]["hexanator"]

0 commit comments

Comments
 (0)