mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-08-10 02:33:04 +02:00
Use the actual remoteterm version for the client_version tag so letsmesh rollups work better
This commit is contained in:
@@ -260,8 +260,8 @@ def _build_radio_info() -> str:
|
|||||||
|
|
||||||
|
|
||||||
def _get_client_version() -> str:
|
def _get_client_version() -> str:
|
||||||
"""Return a client version string like ``'RemoteTerm 2.4.0'``."""
|
"""Return the app version string for community MQTT payloads."""
|
||||||
return f"RemoteTerm {get_app_build_info().version}"
|
return get_app_build_info().version
|
||||||
|
|
||||||
|
|
||||||
class CommunityMqttPublisher(BaseMqttPublisher):
|
class CommunityMqttPublisher(BaseMqttPublisher):
|
||||||
|
|||||||
@@ -1215,17 +1215,18 @@ class TestBuildRadioInfo:
|
|||||||
|
|
||||||
|
|
||||||
class TestGetClientVersion:
|
class TestGetClientVersion:
|
||||||
def test_returns_remoteterm_prefix(self):
|
def test_returns_plain_version(self):
|
||||||
"""Should return 'RemoteTerm ...' string."""
|
"""Should return a bare version string with no product prefix."""
|
||||||
result = _get_client_version()
|
result = _get_client_version()
|
||||||
assert result.startswith("RemoteTerm ")
|
assert result
|
||||||
|
assert "RemoteTerm" not in result
|
||||||
|
|
||||||
def test_returns_version_from_build_helper(self):
|
def test_returns_version_from_build_helper(self):
|
||||||
"""Should use the shared backend build-info helper."""
|
"""Should use the shared backend build-info helper."""
|
||||||
with patch("app.fanout.community_mqtt.get_app_build_info") as mock_build_info:
|
with patch("app.fanout.community_mqtt.get_app_build_info") as mock_build_info:
|
||||||
mock_build_info.return_value.version = "1.2.3"
|
mock_build_info.return_value.version = "1.2.3"
|
||||||
result = _get_client_version()
|
result = _get_client_version()
|
||||||
assert result == "RemoteTerm 1.2.3"
|
assert result == "1.2.3"
|
||||||
|
|
||||||
|
|
||||||
class TestPublishStatus:
|
class TestPublishStatus:
|
||||||
|
|||||||
Reference in New Issue
Block a user