lint fixes (tests)

This commit is contained in:
2024-07-31 16:30:43 +02:00
parent 63c8e39b59
commit f7cc4d9d4e
5 changed files with 80 additions and 10 deletions

View File

@ -1,8 +1,14 @@
'''
Test flushing pf tables
'''
from types import SimpleNamespace
from subprocess import CalledProcessError
def test_flush(client, mocker, valid_credentials):
'''
Test flushing existing entry
'''
def noop():
pass
run_res = SimpleNamespace()
@ -22,6 +28,9 @@ def test_flush(client, mocker, valid_credentials):
def test_flush_nonexistent(client, mocker, valid_credentials):
'''
Test flushing non existing entry
'''
cmd = ['/usr/local/bin/sudo',
'/sbin/pfctl', '-a', 'some/anchor',
@ -42,6 +51,9 @@ def test_flush_nonexistent(client, mocker, valid_credentials):
def test_wrong_method(client, mocker, valid_credentials):
'''
Test invalid method
'''
cmd = ['/usr/local/bin/sudo',
'/sbin/pfctl', '-a', 'some/anchor',
@ -61,7 +73,10 @@ def test_wrong_method(client, mocker, valid_credentials):
assert response.status_code == 405
def test_filenotfound(app, mocker, valid_credentials):
def test_filenotfound(app, valid_credentials):
'''
Test for when AUTHFILE cannot be found
'''
app.config.update({
"AUTHFILE": '../tests/nonexistent-users-test.txt'