Skip to content

Commit

Permalink
fix up test
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodong-Yang committed Dec 20, 2024
1 parent 17a8ad9 commit e2d934f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,16 @@ def setup_executor(self, mocker: pytest_mock.MockerFixture):
def ecu_info_fixture(tmp_path: Path) -> ECUInfo:
_yaml_f = tmp_path / "ecu_info.yaml"
_yaml_f.write_text(ECU_INFO_YAML)
return parse_ecu_info(_yaml_f)
_, res = parse_ecu_info(_yaml_f)
return res


@pytest.fixture
def proxy_info_fixture(tmp_path: Path) -> ProxyInfo:
_yaml_f = tmp_path / "proxy_info.yaml"
_yaml_f.write_text(PROXY_INFO_YAML)
return parse_proxy_info(_yaml_f)
_, res = parse_proxy_info(_yaml_f)
return res


MAX_TRACEBACK_SIZE = 2048
Expand Down
2 changes: 1 addition & 1 deletion tests/test_otaclient/test_configs/test_ecu_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def test_ecu_info(tmp_path: Path, ecu_info_yaml: str, expected_ecu_info: ECUInfo
(ecu_info_file := ota_dir / "ecu_info.yaml").write_text(ecu_info_yaml)

# --- execution --- #
loaded_ecu_info = parse_ecu_info(ecu_info_file)
_, loaded_ecu_info = parse_ecu_info(ecu_info_file)

# --- assertion --- #
assert loaded_ecu_info == expected_ecu_info
2 changes: 1 addition & 1 deletion tests/test_otaclient/test_configs/test_proxy_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@
def test_proxy_info(tmp_path: Path, _input_yaml: str, _expected: ProxyInfo):
proxy_info_file = tmp_path / "proxy_info.yml"
proxy_info_file.write_text(_input_yaml)
_proxy_info = parse_proxy_info(str(proxy_info_file))
_, _proxy_info = parse_proxy_info(str(proxy_info_file))

assert _proxy_info == _expected

0 comments on commit e2d934f

Please sign in to comment.