Files
MeshChatX/tests/backend/test_interface_editor.py
Sudo-Ivan 00b4290735
All checks were successful
CI / test-backend (push) Successful in 15s
CI / lint (push) Successful in 42s
CI / build-frontend (push) Successful in 9m35s
feat(tests): add comprehensive test suite for backend functionality, including database, configuration, and telemetry utilities
2026-01-02 19:41:05 -06:00

26 lines
789 B
Python

from meshchatx.src.backend.interface_editor import InterfaceEditor
def test_update_value_add():
details = {"type": "TCPClientInterface"}
InterfaceEditor.update_value(details, {"host": "1.2.3.4"}, "host")
assert details["host"] == "1.2.3.4"
def test_update_value_update():
details = {"host": "1.2.3.4"}
InterfaceEditor.update_value(details, {"host": "8.8.8.8"}, "host")
assert details["host"] == "8.8.8.8"
def test_update_value_remove_on_none():
details = {"host": "1.2.3.4"}
InterfaceEditor.update_value(details, {"host": None}, "host")
assert "host" not in details
def test_update_value_remove_on_empty_string():
details = {"host": "1.2.3.4"}
InterfaceEditor.update_value(details, {"host": ""}, "host")
assert "host" not in details