1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-02-02 09:47:13 +03:00

Fixed test for openstack

This commit is contained in:
Adolfo Gómez García 2024-04-09 23:49:55 +02:00
parent c95d54eea8
commit e5e72de4b4
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23
2 changed files with 5 additions and 0 deletions

View File

@ -236,6 +236,10 @@ def get_id(iterable: typing.Iterable[T], id: str) -> T:
return next(filter(lambda x: x.id == id, iterable)) # type: ignore
except StopIteration:
raise ValueError(f'Id {id} not found in iterable') from None
def set_all_vms_status(status: openstack_types.ServerStatus) -> None:
for vm in SERVERS_LIST:
vm.status = status
# Methods that returns None or "internal" methods are not tested

View File

@ -50,6 +50,7 @@ class TestOpenstackFixedUserService(UDSTransactionTestCase):
"""
Test the user service
"""
fixtures.set_all_vms_status(openstack_types.ServerStatus.ACTIVE)
for patcher in (fixtures.patched_provider, fixtures.patched_provider_legacy):
with patcher() as prov:
service = fixtures.create_fixed_service(prov) # Will use provider patched api