MCPcopy
hub / github.com/freedomofpress/dangerzone / test_disable_updates

Function test_disable_updates

tests/test_updater_installer.py:221–240  ·  view source on GitHub ↗

8. Disable updates

(mocker: MockerFixture)

Source from the content-addressed store, hash-verified

219
220
221def test_disable_updates(mocker: MockerFixture) -> None:
222 """8. Disable updates"""
223 mocker.patch(
224 f"{installer}.runtime.list_image_digests",
225 return_value=["ghcr.io/freedomofpress/dangerzone/v1:latest"],
226 )
227 mocker.patch(
228 f"{installer}.runtime.expected_image_name",
229 return_value="ghcr.io/freedomofpress/dangerzone/v1",
230 )
231 mocker.patch(f"{installer}.Settings").return_value.get.side_effect = lambda key: {
232 "updater_check_all": False
233 }.get(key)
234 mocker.patch("dangerzone.updater.signatures.Path.exists", return_value=True)
235 mocker.patch(f"{installer}.get_last_log_index", return_value=300)
236 mocker.patch(f"{installer}.LAST_KNOWN_LOG_INDEX", 200)
237 mocker.patch(f"{installer}.is_container_tar_bundled", return_value=True)
238
239 result = get_installation_strategy()
240 assert result == Strategy.DO_NOTHING
241
242
243def test_podman_state_reset_updates_enabled(mocker: MockerFixture) -> None:

Callers

nothing calls this directly

Calls 2

getMethod · 0.80

Tested by

no test coverage detected