feature/integracion-panel-restore-targets
This commit is contained in:
41
tests/test_colocated_resolve.py
Normal file
41
tests/test_colocated_resolve.py
Normal file
@@ -0,0 +1,41 @@
|
||||
"""
|
||||
Pruebas de validación modo colocado (target.name vs instance_key).
|
||||
"""
|
||||
import pytest
|
||||
|
||||
from app.panel import panel_client
|
||||
|
||||
|
||||
def test_validate_colocado_acepta_sin_ssh():
|
||||
data = {
|
||||
"id": 1,
|
||||
"name": "Omega",
|
||||
"server": "192.168.1.10",
|
||||
"username": "sa",
|
||||
"password": "x",
|
||||
"data_folder": "C:\\SQLData",
|
||||
}
|
||||
assert panel_client._validate_target(data, colocated=True) is True
|
||||
|
||||
|
||||
def test_validate_colocado_rechaza_sin_name():
|
||||
data = {
|
||||
"id": 1,
|
||||
"server": "192.168.1.10",
|
||||
"username": "sa",
|
||||
"password": "x",
|
||||
"data_folder": "C:\\SQLData",
|
||||
}
|
||||
assert panel_client._validate_target(data, colocated=True) is False
|
||||
|
||||
|
||||
def test_validate_hub_exige_ssh():
|
||||
data = {
|
||||
"id": 1,
|
||||
"name": "Omega",
|
||||
"server": "192.168.1.10",
|
||||
"username": "sa",
|
||||
"password": "x",
|
||||
"data_folder": "C:\\SQLData",
|
||||
}
|
||||
assert panel_client._validate_target(data, colocated=False) is False
|
||||
Reference in New Issue
Block a user