mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-03 01:17:56 +03:00
Fixed proxmox tests
This commit is contained in:
parent
1df9ab40a6
commit
fb3945975c
@ -276,6 +276,7 @@ def replace_vm_info(vmid: int, **kwargs: typing.Any) -> client.types.UPID:
|
||||
for i in range(len(VMS_INFO)):
|
||||
if VMS_INFO[i].vmid == vmid:
|
||||
VMS_INFO[i] = VMS_INFO[i]._replace(**kwargs)
|
||||
break
|
||||
return UPID
|
||||
|
||||
|
||||
@ -363,7 +364,7 @@ CLIENT_METHODS_INFO: typing.Final[list[AutoSpecMethodInfo]] = [
|
||||
client.ProxmoxClient.get_storage,
|
||||
returns=lambda storage, node, **kwargs: next( # pyright: ignore
|
||||
filter(lambda s: s.storage == storage, STORAGES) # pyright: ignore
|
||||
), # pyright: ignore
|
||||
),
|
||||
),
|
||||
# list_storages
|
||||
AutoSpecMethodInfo(
|
||||
|
@ -39,7 +39,7 @@ from . import fixtures
|
||||
from ...utils.test import UDSTransactionTestCase
|
||||
|
||||
|
||||
class TestProxmovFixedService(UDSTransactionTestCase):
|
||||
class TestProxmoxFixedService(UDSTransactionTestCase):
|
||||
|
||||
def test_service_is_available(self) -> None:
|
||||
"""
|
||||
|
@ -202,7 +202,7 @@ class TestProxmoxLinkedUserService(UDSTransactionTestCase):
|
||||
api.get_machine_pool_info.assert_called_with(vmid, service.pool.value, force=True)
|
||||
api.start_machine.assert_called_with(vmid)
|
||||
|
||||
# Ensure vm is stopped
|
||||
# Ensure vm is stopped, because deployment should have started it (as api.start_machine was called)
|
||||
fixtures.replace_vm_info(vmid, status='stopped')
|
||||
# Set ready state with the valid machine
|
||||
state = userservice.set_ready()
|
||||
|
Loading…
Reference in New Issue
Block a user