From 96e853b5a9610963a39a2abd8c843acbf995492c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Wed, 26 Jun 2024 01:59:16 +0200 Subject: [PATCH] Fixed FixedService to include default "get_token" method (based on token field) --- server/src/tests/services/openstack/test_userservice_fixed.py | 4 ++-- server/src/tests/services/xen/test_userservice_fixed.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/tests/services/openstack/test_userservice_fixed.py b/server/src/tests/services/openstack/test_userservice_fixed.py index 081db5d9a..bdc843a4a 100644 --- a/server/src/tests/services/openstack/test_userservice_fixed.py +++ b/server/src/tests/services/openstack/test_userservice_fixed.py @@ -73,8 +73,8 @@ class TestOpenstackFixedUserService(UDSTransactionTestCase): self.assertEqual(state, types.states.TaskState.FINISHED) - # userservice_db Should have halle set_in_use(True) - userservice_db.set_in_use.assert_called_once_with(True) + if service.get_token() is None: + userservice_db.set_in_use.assert_called_once_with(True) # vmid should have been assigned, so it must be in the assigned machines with service._assigned_access() as assigned_machines: diff --git a/server/src/tests/services/xen/test_userservice_fixed.py b/server/src/tests/services/xen/test_userservice_fixed.py index 5bf8dfdeb..f9c61de8f 100644 --- a/server/src/tests/services/xen/test_userservice_fixed.py +++ b/server/src/tests/services/xen/test_userservice_fixed.py @@ -76,8 +76,8 @@ class TestXenFixedUserService(UDSTransactionTestCase): self.assertEqual(state, types.states.TaskState.FINISHED) - # userservice_db Should have halle set_in_use(True) - userservice_db.set_in_use.assert_called_once_with(True) + if service.get_token() is None: + userservice_db.set_in_use.assert_called_once_with(True) # vmid should have been assigned, so it must be in the assigned machines with service._assigned_access() as assigned_machines: