test: date "later" saves and states a year ahead, not in 2099 (#5474)

This commit is contained in:
Sam Dornan
2026-11-03 07:44:16 -06:00
committed by GitHub
parent b96a9e8a30
commit 260abdfd8f
2 changed files with 7 additions and 7 deletions

View File

@@ -5548,7 +5548,7 @@ def test_a_streamed_state_is_the_one_cloud_sync_serves_for_its_slot(
"Game.20261008-153825000000.state.auto",
"mgba",
core="mgba",
updated_at=datetime(2099, 1, 1, tzinfo=timezone.utc),
updated_at=datetime.now(timezone.utc) + timedelta(days=365),
)
served = retroarch_sync.resolve_state_by_slot(
@@ -5683,7 +5683,7 @@ def test_hydrate_pushes_a_newer_cloud_synced_state_of_the_booted_core(
admin_user,
"Game.state.auto",
"bsnes",
updated_at=datetime(2099, 1, 1, tzinfo=timezone.utc),
updated_at=datetime.now(timezone.utc) + timedelta(days=365),
)
push = _hydrate_core(
rom, admin_user, "retroarch:bsnes", states.StateCore("bsnes", False)

View File

@@ -1734,12 +1734,12 @@ class TestNegotiateBaseline:
assert upload.status_code == status.HTTP_200_OK
# The server moves on after the boundary the upload recorded.
later = (datetime.now(timezone.utc) + timedelta(days=365)).replace(
microsecond=0
)
db_save_handler.update_save(
upload.json()["id"],
{
"content_hash": "server_new",
"updated_at": datetime(2099, 1, 1, tzinfo=timezone.utc),
},
{"content_hash": "server_new", "updated_at": later},
)
with mock.patch(
@@ -1755,7 +1755,7 @@ class TestNegotiateBaseline:
"file_name": "chain.sav",
"slot": "autosave",
"content_hash": "client_hash",
"updated_at": "2099-01-01T00:00:00Z",
"updated_at": later.isoformat(),
"file_size_bytes": 100,
}
],