mirror of
https://github.com/meshtastic/python.git
synced 2026-04-17 13:31:43 -04:00
23 lines
826 B
Python
23 lines
826 B
Python
"""Meshtastic unit tests for traffic management handling in mesh_interface.py."""
|
|
|
|
import pytest
|
|
|
|
from ..mesh_interface import MeshInterface
|
|
from ..protobuf import mesh_pb2
|
|
|
|
|
|
@pytest.mark.unit
|
|
@pytest.mark.usefixtures("reset_mt_config")
|
|
def test_handleFromRadio_with_traffic_management_module_config():
|
|
"""Test _handleFromRadio with moduleConfig.traffic_management."""
|
|
iface = MeshInterface(noProto=True)
|
|
from_radio = mesh_pb2.FromRadio()
|
|
from_radio.moduleConfig.traffic_management.enabled = True
|
|
from_radio.moduleConfig.traffic_management.rate_limit_enabled = True
|
|
|
|
iface._handleFromRadio(from_radio.SerializeToString())
|
|
|
|
assert iface.localNode.moduleConfig.traffic_management.enabled is True
|
|
assert iface.localNode.moduleConfig.traffic_management.rate_limit_enabled is True
|
|
iface.close()
|