1
0
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:
Adolfo Gómez García 2024-04-02 23:39:51 +02:00
parent 1df9ab40a6
commit fb3945975c
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23
3 changed files with 4 additions and 3 deletions

View File

@ -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(

View File

@ -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:
"""

View File

@ -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()