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 Nov 8, 2024
1 parent 27e333b commit bde4162
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/test_otaclient/test_create_standby.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ def test_update_with_rebuild_mode(self, mocker: MockerFixture):
otaclient_control_flags = typing.cast(
OTAClientControlFlags, mocker.MagicMock(spec=OTAClientControlFlags)
)
otaclient_control_flags._can_reboot = _can_reboot = mocker.MagicMock()
_can_reboot.is_set = mocker.MagicMock(return_value=True)

ca_store = load_ca_cert_chains(cfg.CERTS_DIR)

Expand Down
5 changes: 4 additions & 1 deletion tests/test_otaclient/test_ota_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ def test_otaupdater(self, mocker: pytest_mock.MockerFixture):
otaclient_control_flags = typing.cast(
OTAClientControlFlags, mocker.MagicMock(spec=OTAClientControlFlags)
)
otaclient_control_flags._can_reboot = _can_reboot = mocker.MagicMock()
_can_reboot.is_set = mocker.MagicMock(return_value=True)

ca_store = load_ca_cert_chains(cfg.CERTS_DIR)

_updater = _OTAUpdater(
Expand All @@ -199,7 +202,7 @@ def test_otaupdater(self, mocker: pytest_mock.MockerFixture):
_downloaded_files_size += _f.stat().st_size
assert _downloaded_files_size == self._delta_bundle.total_download_files_size
# assert the control_flags has been waited
otaclient_control_flags.wait_can_reboot_flag.assert_called_once()
otaclient_control_flags._can_reboot.is_set.assert_called_once()
assert _updater.updating_version == str(cfg.UPDATE_VERSION)
# assert boot controller is used
self._boot_control.pre_update.assert_called_once()
Expand Down

0 comments on commit bde4162

Please sign in to comment.