mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
actions: Drop unused superuser_run and related methods
Tests: - All tests in patch series have been done with this patch applied - Unit tests pass Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
0bda4843a7
commit
5c5fc9eb61
5 files changed
+3
-413
No files matched your search
-20
@@ -148,26 +148,6 @@ def fixture_actions_module(request):
|
||||
return module
|
||||
|
||||
|
||||
@pytest.fixture(name='call_action')
|
||||
def fixture_call_action(request, capsys, actions_module):
|
||||
"""Run actions with custom root path."""
|
||||
|
||||
actions_name = getattr(request.module, 'actions_name')
|
||||
|
||||
def _call_action(*args, **_kwargs):
|
||||
if isinstance(args[0], list):
|
||||
argv = [actions_name] + args[0] # Command line style usage
|
||||
else:
|
||||
argv = [args[0]] + args[1] # superuser_run style usage
|
||||
|
||||
with patch('argparse._sys.argv', argv):
|
||||
actions_module.main()
|
||||
captured = capsys.readouterr()
|
||||
return captured.out
|
||||
|
||||
return _call_action
|
||||
|
||||
|
||||
@pytest.fixture(name='mock_privileged')
|
||||
def fixture_mock_privileged(request):
|
||||
"""Mock the privileged decorator to nullify its effects."""
|
||||
|
||||
Reference in new issue
Block a user