lint fixes (tests)
This commit is contained in:
@ -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'
|
||||
|
||||
Reference in New Issue
Block a user