From c67f34daca4115b9f58b02cd6f023451cef62bfa Mon Sep 17 00:00:00 2001 From: Tim Head Date: Mon, 15 Oct 2018 16:03:31 +0200 Subject: [PATCH] Add tests for per user memory limit --- tests/test_configurer.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_configurer.py b/tests/test_configurer.py index df4b69f..59dd6ec 100644 --- a/tests/test_configurer.py +++ b/tests/test_configurer.py @@ -59,6 +59,22 @@ def apply_mock_config(overrides): return c +def test_default_memory_limit(): + """ + Test default per user memory limit + """ + c = apply_mock_config({}) + assert c.SystemdSpawner.mem_limit is None + + +def test_set_memory_limit(): + """ + Test setting per user memory limit + """ + c = apply_mock_config({'limits': {'memory': '42G'}}) + assert c.SystemdSpawner.mem_limit == '42G' + + def test_app_default(): """ Test default application with no config overrides.