mirror of
https://github.com/craigerl/aprsd.git
synced 2025-09-02 21:27:56 -04:00
fix pep8 failures
This commit is contained in:
parent
f0ad6d7577
commit
e9c48c1914
@ -10,6 +10,7 @@ from aprsd import threads as aprsd_threads
|
|||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
LOG = logging.getLogger("APRSD")
|
LOG = logging.getLogger("APRSD")
|
||||||
|
|
||||||
|
|
||||||
class APRSRegistryThread(aprsd_threads.APRSDThread):
|
class APRSRegistryThread(aprsd_threads.APRSDThread):
|
||||||
"""This sends service information to the configured APRS Registry."""
|
"""This sends service information to the configured APRS Registry."""
|
||||||
_loop_cnt: int = 1
|
_loop_cnt: int = 1
|
||||||
@ -34,7 +35,7 @@ class APRSRegistryThread(aprsd_threads.APRSDThread):
|
|||||||
"description": CONF.registry.description,
|
"description": CONF.registry.description,
|
||||||
"service_website": CONF.registry.service_website,
|
"service_website": CONF.registry.service_website,
|
||||||
"software": f"APRSD version {aprsd.__version__} "
|
"software": f"APRSD version {aprsd.__version__} "
|
||||||
"https://github.com/craigerl/aprsd",
|
"https://github.com/craigerl/aprsd",
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
requests.post(
|
requests.post(
|
||||||
|
@ -56,17 +56,20 @@ class TestSendMessageCommand(unittest.TestCase):
|
|||||||
msg_number=1,
|
msg_number=1,
|
||||||
message_format=core.PACKET_TYPE_ACK,
|
message_format=core.PACKET_TYPE_ACK,
|
||||||
)
|
)
|
||||||
|
mock_queue = mock.MagicMock()
|
||||||
socketio = mock.MagicMock()
|
socketio = mock.MagicMock()
|
||||||
wcp = webchat.WebChatProcessPacketThread(packet, socketio)
|
wcp = webchat.WebChatProcessPacketThread(mock_queue, socketio)
|
||||||
|
|
||||||
wcp.process_ack_packet(packet)
|
wcp.process_ack_packet(packet)
|
||||||
mock_remove.called_once()
|
mock_remove.called_once()
|
||||||
mock_socketio.called_once()
|
mock_socketio.called_once()
|
||||||
|
|
||||||
|
@mock.patch("aprsd.threads.tx.send")
|
||||||
@mock.patch("aprsd.packets.PacketList.rx")
|
@mock.patch("aprsd.packets.PacketList.rx")
|
||||||
@mock.patch("aprsd.cmds.webchat.socketio")
|
@mock.patch("aprsd.cmds.webchat.socketio")
|
||||||
def test_process_our_message_packet(
|
def test_process_our_message_packet(
|
||||||
self,
|
self,
|
||||||
|
mock_tx_send,
|
||||||
mock_packet_add,
|
mock_packet_add,
|
||||||
mock_socketio,
|
mock_socketio,
|
||||||
):
|
):
|
||||||
@ -77,8 +80,9 @@ class TestSendMessageCommand(unittest.TestCase):
|
|||||||
msg_number=1,
|
msg_number=1,
|
||||||
message_format=core.PACKET_TYPE_MESSAGE,
|
message_format=core.PACKET_TYPE_MESSAGE,
|
||||||
)
|
)
|
||||||
|
mock_queue = mock.MagicMock()
|
||||||
socketio = mock.MagicMock()
|
socketio = mock.MagicMock()
|
||||||
wcp = webchat.WebChatProcessPacketThread(packet, socketio)
|
wcp = webchat.WebChatProcessPacketThread(mock_queue, socketio)
|
||||||
|
|
||||||
wcp.process_our_message_packet(packet)
|
wcp.process_our_message_packet(packet)
|
||||||
mock_packet_add.called_once()
|
mock_packet_add.called_once()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user