diff --git a/tests/test_manager.py b/tests/test_manager.py index bfe4d53..3108402 100644 --- a/tests/test_manager.py +++ b/tests/test_manager.py @@ -12,11 +12,23 @@ from resallocserver import models from resallocserver.app import session_scope from resallocserver.main import Synchronizer -from resallocserver.manager import Manager, CrossPoolConfig +from resallocserver.manager import Manager, CrossPoolConfig, normalize_tags from tests import ResallocTestCase +def test_normalize_tags(): + """ Test that the normalize_tag() properly modifies the tags """ + tags = ["a"] + normalize_tags(tags) + assert tags == [{"name": "a", "priority": 0}] + tags = ["a", {"name": "b"}, {"name": "c", "priority": 10}] + normalize_tags(tags) + assert tags == [{"name": "a", "priority": 0}, + {"name": "b", "priority": 0}, + {"name": "c", "priority": 10}] + + class TestManager(ResallocTestCase): @pytest.mark.parametrize(