From 836056f404fcd9f35e69267718db9d17c7144453 Mon Sep 17 00:00:00 2001 From: stevejpurves Date: Mon, 20 Mar 2023 17:53:31 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20green=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_configurer.py | 53 ++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/tests/test_configurer.py b/tests/test_configurer.py index e2f5179..e05d051 100644 --- a/tests/test_configurer.py +++ b/tests/test_configurer.py @@ -193,33 +193,6 @@ def test_cull_service_default(): } ] -def test_cull_service_named(): - """ - Test default cull service settings with named server removal - """ - c = apply_mock_config( - {"services": {"cull": {"every": 10, "remove_named_servers": True, "max_age": 60}}} - ) - - cull_cmd = [ - sys.executable, - "-m", - "jupyterhub_idle_culler", - "--timeout=600", - "--cull-every=10", - "--concurrency=5", - "--max-age=60", - "--remove-named-servers", - ] - assert c.JupyterHub.services == [ - { - "name": "cull-idle", - "admin": True, - "command": cull_cmd, - } - ] - - def test_set_cull_service(): """ Test setting cull service options @@ -245,6 +218,32 @@ def test_set_cull_service(): } ] +def test_cull_service_named(): + """ + Test default cull service settings with named server removal + """ + c = apply_mock_config( + {"services": {"cull": {"every": 10, "cull_users": True, "remove_named_servers": True, "max_age": 60}}} + ) + + cull_cmd = [ + sys.executable, + "-m", + "jupyterhub_idle_culler", + "--timeout=600", + "--cull-every=10", + "--concurrency=5", + "--max-age=60", + "--cull-users", + "--remove-named-servers", + ] + assert c.JupyterHub.services == [ + { + "name": "cull-idle", + "admin": True, + "command": cull_cmd, + } + ] def test_load_secrets(tljh_dir): """