Move to hour-resolution adverts

This commit is contained in:
Jack Kingsman
2026-02-23 16:34:34 -08:00
parent 88d5a76081
commit ef4c79bc80
6 changed files with 90 additions and 31 deletions
+15
View File
@@ -47,6 +47,21 @@ class TestUpdateSettings:
assert result.max_radio_contacts == 321
assert result.advert_interval == 3600
@pytest.mark.asyncio
async def test_advert_interval_below_minimum_is_clamped_to_one_hour(self, test_db):
result = await update_settings(AppSettingsUpdate(advert_interval=600))
assert result.advert_interval == 3600
@pytest.mark.asyncio
async def test_advert_interval_zero_stays_disabled(self, test_db):
result = await update_settings(AppSettingsUpdate(advert_interval=0))
assert result.advert_interval == 0
@pytest.mark.asyncio
async def test_advert_interval_above_minimum_is_preserved(self, test_db):
result = await update_settings(AppSettingsUpdate(advert_interval=86400))
assert result.advert_interval == 86400
@pytest.mark.asyncio
async def test_empty_patch_returns_current_settings(self, test_db):
result = await update_settings(AppSettingsUpdate())