diff --git a/src/spoc/__init__.py b/src/spoc/__init__.py index 38a634b..a1231f2 100644 --- a/src/spoc/__init__.py +++ b/src/spoc/__init__.py @@ -73,8 +73,8 @@ def stop(app_name): raise AppNotInstalledError(app_name) podman.stop_pod(app_name) -def status(app_name): - if app_name not in podman.get_apps(): +def status(app_name=None): + if app_name is not None and app_name not in podman.get_apps(): raise AppNotInstalledError(app_name) return podman.get_pod_status(app_name) diff --git a/tests/test_spoc.py b/tests/test_spoc.py index 2aa6d0a..e815608 100644 --- a/tests/test_spoc.py +++ b/tests/test_spoc.py @@ -185,6 +185,15 @@ def test_status(get_pod_status, podman_get_apps): get_pod_status.assert_called_once_with('someapp') 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_pod_status') def test_status_not_installed(get_pod_status, podman_get_apps):