mirror of
https://github.com/meshtastic/python.git
synced 2026-01-15 19:28:05 -05:00
Fix up pylint from merged PR
This commit is contained in:
@@ -12,7 +12,6 @@ from datetime import datetime
|
||||
|
||||
import google.protobuf.json_format
|
||||
import timeago # type: ignore[import-untyped]
|
||||
from google.protobuf.json_format import MessageToJson
|
||||
from pubsub import pub # type: ignore[import-untyped]
|
||||
from tabulate import tabulate
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@ import base64
|
||||
import logging
|
||||
import time
|
||||
|
||||
from google.protobuf.json_format import MessageToJson
|
||||
|
||||
from meshtastic import admin_pb2, apponly_pb2, channel_pb2, localonly_pb2, portnums_pb2
|
||||
from meshtastic.util import (
|
||||
Timeout,
|
||||
|
||||
@@ -551,6 +551,7 @@ def test_active_ports_on_supported_devices_mac_duplicates_check(mock_platform, m
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_message_to_json_shows_all():
|
||||
"""Test that message_to_json prints fields that aren't included in data passed in"""
|
||||
actual = json.loads(message_to_json(MyNodeInfo()))
|
||||
expected = { "myNodeNum": 0, "rebootCount": 0, "minAppVersion": 0 }
|
||||
assert actual == expected
|
||||
|
||||
@@ -614,5 +614,5 @@ def check_if_newer_version():
|
||||
return pypi_version
|
||||
|
||||
def message_to_json(message):
|
||||
"Return protobuf message as JSON. Always print all fields, even when not present in data."
|
||||
return stripnl(MessageToJson(message, always_print_fields_with_no_presence=True))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user