Add resources tests

This commit is contained in:
Benoît Seignovert 2024-02-08 16:37:20 +01:00
parent f00b406962
commit bf8bce2fb1
Signed by: Benoît Seignovert
GPG key ID: F5D8895227D18A0B
4 changed files with 39 additions and 12 deletions

24
tests/test_resources.py Normal file
View file

@ -0,0 +1,24 @@
"""Test resources module."""
from glicid_spawner.resources import CPU, GPU, RAM
def test_glicid_default_resources():
"""Test GLiCID default resources."""
assert len(CPU) == 6
assert CPU[0].description == '1'
assert CPU[0].max_duration == 24
assert CPU[-1].description == '24'
assert CPU[-1].max_duration == 1
assert len(RAM) == 6
assert RAM[0].description == '4 GB'
assert RAM[0].max_duration == 24
assert RAM[-1].description == '96 GB'
assert RAM[-1].max_duration == 1
assert len(GPU) == 2
assert GPU[0].description == 'No'
assert GPU[0].max_duration == 24
assert GPU[-1].description == 'A100'
assert GPU[-1].max_duration == 1