forked from p15670423/monkey
UT: Fix configuration logic to work with pydantic in `agent_configuration` fixture
This commit is contained in:
parent
016cf80cdd
commit
f11e2dc8a1
|
@ -1,4 +1,3 @@
|
||||||
from dataclasses import replace
|
|
||||||
from unittest.mock import MagicMock
|
from unittest.mock import MagicMock
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
@ -18,12 +17,10 @@ WINDOWS_FILENAME = "windows_pba_file.ps1"
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def agent_configuration(default_agent_configuration: AgentConfiguration) -> AgentConfiguration:
|
def agent_configuration(default_agent_configuration: AgentConfiguration) -> AgentConfiguration:
|
||||||
custom_pbas = replace(
|
custom_pbas = default_agent_configuration.custom_pbas.copy(
|
||||||
default_agent_configuration.custom_pbas,
|
update={"linux_filename": LINUX_FILENAME, "windows_filename": WINDOWS_FILENAME},
|
||||||
linux_filename=LINUX_FILENAME,
|
|
||||||
windows_filename=WINDOWS_FILENAME,
|
|
||||||
)
|
)
|
||||||
return replace(default_agent_configuration, custom_pbas=custom_pbas)
|
return default_agent_configuration.copy(update={"custom_pbas": custom_pbas})
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|
Loading…
Reference in New Issue