mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Checkpoint game before sim, auto-revert on abort.
An alternative to https://github.com/dcs-liberation/dcs_liberation/pull/2891 that I ended up liking much better (I had assumed some part of the UI would fail or at least look terrible with this approach, but it seems to work quite well). On by default now since it's far less frightening than the previous thing. Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2735.
This commit is contained in:
@@ -56,6 +56,16 @@ def test_save_start_of_turn(game: Game, tmp_bundle: SaveGameBundle) -> None:
|
||||
assert zip_file.namelist() == [SaveGameBundle.START_OF_TURN_SAVE_NAME]
|
||||
|
||||
|
||||
def test_save_pre_sim_checkpoint(game: Game, tmp_bundle: SaveGameBundle) -> None:
|
||||
with ZipFile(tmp_bundle.bundle_path, "r") as zip_file:
|
||||
with pytest.raises(KeyError):
|
||||
zip_file.read(SaveGameBundle.PRE_SIM_CHECKPOINT_SAVE_NAME)
|
||||
tmp_bundle.save_pre_sim_checkpoint(game)
|
||||
|
||||
with ZipFile(tmp_bundle.bundle_path, "r") as zip_file:
|
||||
assert zip_file.namelist() == [SaveGameBundle.PRE_SIM_CHECKPOINT_SAVE_NAME]
|
||||
|
||||
|
||||
def test_failed_save_leaves_original_intact(
|
||||
game: Game, tmp_bundle: SaveGameBundle
|
||||
) -> None:
|
||||
|
||||
Reference in New Issue
Block a user