mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-08-10 02:33:04 +02:00
Add background-hash-mark addition for region routing
Per https://buymeacoffee.com/ripplebiz/region-filtering: > After some discussions, and that there is some confusion around #channels and #regions, it's been decided to drop the requirement to have the '#' prefix. So, region names will just be plain alphanumeric (and '-'), with no # prefix. > For backwards compatibility, the names will internally have a '#' prepended, but for all client GUI's and command lines, you generally won't see mention of '#' prefixes. The next firmware release (v1.12.0) and subsequent Ripple firmware and Liam's app will have modified UI to remove the '#' requirement. So, silently add, but don't duplicate, for users who have already added hashmarks.
This commit is contained in:
@@ -55,7 +55,7 @@ class TestUpdateSettings:
|
||||
@pytest.mark.asyncio
|
||||
async def test_flood_scope_round_trip(self, test_db):
|
||||
"""Flood scope should be saved and retrieved correctly."""
|
||||
result = await update_settings(AppSettingsUpdate(flood_scope="#MyRegion"))
|
||||
result = await update_settings(AppSettingsUpdate(flood_scope="MyRegion"))
|
||||
assert result.flood_scope == "#MyRegion"
|
||||
|
||||
fresh = await AppSettingsRepository.get()
|
||||
@@ -70,7 +70,13 @@ class TestUpdateSettings:
|
||||
@pytest.mark.asyncio
|
||||
async def test_flood_scope_whitespace_stripped(self, test_db):
|
||||
"""Flood scope should be stripped of whitespace."""
|
||||
result = await update_settings(AppSettingsUpdate(flood_scope=" #MyRegion "))
|
||||
result = await update_settings(AppSettingsUpdate(flood_scope=" MyRegion "))
|
||||
assert result.flood_scope == "#MyRegion"
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_flood_scope_existing_hash_is_not_doubled(self, test_db):
|
||||
"""Existing leading hash should be preserved for backward compatibility."""
|
||||
result = await update_settings(AppSettingsUpdate(flood_scope="#MyRegion"))
|
||||
assert result.flood_scope == "#MyRegion"
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -92,7 +98,7 @@ class TestUpdateSettings:
|
||||
mock_rm.radio_operation = mock_radio_op
|
||||
|
||||
with patch("app.radio.radio_manager", mock_rm):
|
||||
await update_settings(AppSettingsUpdate(flood_scope="#TestRegion"))
|
||||
await update_settings(AppSettingsUpdate(flood_scope="TestRegion"))
|
||||
|
||||
mock_mc.commands.set_flood_scope.assert_awaited_once_with("#TestRegion")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user