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:
parent
c95d54eea8
commit
e5e72de4b4
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user