diff --git a/tests/test_list.py b/tests/test_list.py index b7365c4..055331d 100644 --- a/tests/test_list.py +++ b/tests/test_list.py @@ -94,9 +94,13 @@ 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) + mocker.patch('jail2ban.pfctl.run', + return_value=run_res, + side_effect=CalledProcessError(run_res.returncode, + 'foobar', + output=run_res.stdout, + stderr=run_res.stderr) + ) response = client.get("/list/nonexistent", headers={"Authorization":