UT: Fix configuration logic to work with pydantic in `agent_configuration` fixture

This commit is contained in:
Shreya Malviya 2022-08-30 12:43:49 +05:30
parent 016cf80cdd
commit f11e2dc8a1
1 changed files with 3 additions and 6 deletions

View File

@ -1,4 +1,3 @@
from dataclasses import replace
from unittest.mock import MagicMock
import pytest
@ -18,12 +17,10 @@ WINDOWS_FILENAME = "windows_pba_file.ps1"
@pytest.fixture
def agent_configuration(default_agent_configuration: AgentConfiguration) -> AgentConfiguration:
custom_pbas = replace(
default_agent_configuration.custom_pbas,
linux_filename=LINUX_FILENAME,
windows_filename=WINDOWS_FILENAME,
custom_pbas = default_agent_configuration.custom_pbas.copy(
update={"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