Fix getting status for all apps
This commit is contained in:
parent
05f4d7955b
commit
4420d64c45
@ -73,8 +73,8 @@ def stop(app_name):
|
|||||||
raise AppNotInstalledError(app_name)
|
raise AppNotInstalledError(app_name)
|
||||||
podman.stop_pod(app_name)
|
podman.stop_pod(app_name)
|
||||||
|
|
||||||
def status(app_name):
|
def status(app_name=None):
|
||||||
if app_name not in podman.get_apps():
|
if app_name is not None and app_name not in podman.get_apps():
|
||||||
raise AppNotInstalledError(app_name)
|
raise AppNotInstalledError(app_name)
|
||||||
return podman.get_pod_status(app_name)
|
return podman.get_pod_status(app_name)
|
||||||
|
|
||||||
|
@ -185,6 +185,15 @@ def test_status(get_pod_status, podman_get_apps):
|
|||||||
get_pod_status.assert_called_once_with('someapp')
|
get_pod_status.assert_called_once_with('someapp')
|
||||||
assert status == 'RESULT'
|
assert status == 'RESULT'
|
||||||
|
|
||||||
|
@patch('spoc.podman.get_apps')
|
||||||
|
@patch('spoc.podman.get_pod_status', return_value='RESULT')
|
||||||
|
def test_status_all(get_pod_status, podman_get_apps):
|
||||||
|
status = spoc.status()
|
||||||
|
|
||||||
|
podman_get_apps.assert_not_called()
|
||||||
|
get_pod_status.assert_called_once_with(None)
|
||||||
|
assert status == 'RESULT'
|
||||||
|
|
||||||
@patch('spoc.podman.get_apps', return_value={})
|
@patch('spoc.podman.get_apps', return_value={})
|
||||||
@patch('spoc.podman.get_pod_status')
|
@patch('spoc.podman.get_pod_status')
|
||||||
def test_status_not_installed(get_pod_status, podman_get_apps):
|
def test_status_not_installed(get_pod_status, podman_get_apps):
|
||||||
|
Loading…
Reference in New Issue
Block a user