Fix spawner job id parser for SLURM multi cluster config

This commit is contained in:
Benoît Seignovert 2024-02-21 15:11:14 +01:00
parent a038d46231
commit 8574a75e37
Signed by: Benoît Seignovert
GPG key ID: F5D8895227D18A0B
2 changed files with 38 additions and 8 deletions

View file

@ -16,9 +16,20 @@ def test_spawner_config():
assert isinstance(spawner, GlicidSpawner)
assert isinstance(spawner, SlurmSpawner)
assert spawner.glicid_singleuser_cmd == 'glicid-spawner-singleuser'
assert spawner.batchspawner_singleuser_cmd == 'glicid-spawner-singleuser'
assert spawner.req_qos == 'short'
def test_spawner_parse_job_id():
"""Test spawner job id parser."""
spawner = GlicidSpawner()
assert spawner.parse_job_id('123') == 123
assert spawner.parse_job_id('456;nautilus') == '456 -M nautilus'
assert spawner.parse_job_id('') is None
def test_spawner_options_form(monkeypatch):
"""Test spawner options form."""
@ -34,5 +45,5 @@ def test_spawner_options_form(monkeypatch):
spawner = GlicidSpawner(user=User('john-doe'))
assert spawner.user.name == 'john-doe'
assert spawner.options_form() == "options_form('john-doe')"
assert spawner.options_form == "options_form('john-doe')"
assert spawner.options_from_form({'foo': 123}) == "options_from_form({'foo': 123})"