diff --git a/tests/test_list.py b/tests/test_list.py index 6978ef4..b7365c4 100644 --- a/tests/test_list.py +++ b/tests/test_list.py @@ -2,6 +2,7 @@ Tests for /list route ''' from types import SimpleNamespace +from subprocess import CalledProcessError _PF_TABLE_LIST = b''' 192.0.2.66 @@ -93,6 +94,8 @@ def test_list_nonexistent_table(client, mocker, valid_credentials): run_res.returncode = 255 run_res.check_returncode = noop + # XXX raise a CalledProcessError here... + mocker.patch('jail2ban.pfctl.run', return_value=run_res) response = client.get("/list/nonexistent",