mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-13 10:30:16 +00:00
tests: Patch apps_init for enable/disable daemon test
Otherwise, apps_init calls _sort_apps, which randomly fails in functional tests CI job. The failure may be due to the tests running in parallel, since I could not reproduce it locally. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
5e10b2d4ae
commit
6c5fbf6523
@ -77,10 +77,11 @@ def test_is_enabled(service_is_enabled, daemon):
|
|||||||
service_is_enabled.assert_has_calls([call('test-unit', strict_check=True)])
|
service_is_enabled.assert_has_calls([call('test-unit', strict_check=True)])
|
||||||
|
|
||||||
|
|
||||||
|
@patch('plinth.app.apps_init')
|
||||||
@patch('subprocess.run')
|
@patch('subprocess.run')
|
||||||
@patch('subprocess.call')
|
@patch('subprocess.call')
|
||||||
def test_enable(subprocess_call, subprocess_run, app_list, mock_privileged,
|
def test_enable(subprocess_call, subprocess_run, apps_init, app_list,
|
||||||
daemon):
|
mock_privileged, daemon):
|
||||||
"""Test that enabling the daemon works."""
|
"""Test that enabling the daemon works."""
|
||||||
daemon.enable()
|
daemon.enable()
|
||||||
subprocess_call.assert_has_calls(
|
subprocess_call.assert_has_calls(
|
||||||
@ -101,9 +102,11 @@ def test_enable(subprocess_call, subprocess_run, app_list, mock_privileged,
|
|||||||
stdout=subprocess.DEVNULL, check=False)
|
stdout=subprocess.DEVNULL, check=False)
|
||||||
|
|
||||||
|
|
||||||
|
@patch('plinth.app.apps_init')
|
||||||
@patch('subprocess.run')
|
@patch('subprocess.run')
|
||||||
@patch('subprocess.call')
|
@patch('subprocess.call')
|
||||||
def test_disable(subprocess_call, subprocess_run, mock_privileged, daemon):
|
def test_disable(subprocess_call, subprocess_run, apps_init, app_list,
|
||||||
|
mock_privileged, daemon):
|
||||||
"""Test that disabling the daemon works."""
|
"""Test that disabling the daemon works."""
|
||||||
daemon.disable()
|
daemon.disable()
|
||||||
subprocess_call.assert_has_calls(
|
subprocess_call.assert_has_calls(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user