From f82bbc5fc251f167acd6971f75c94d7703ef75f5 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Tue, 6 Dec 2022 15:18:27 +0000 Subject: [PATCH] Sort the Python imports with isort --- data/rdm/PidDataTest.py | 1 + include/ola/gen_callbacks.py | 1 + python/examples/ola_artnet_params.py | 5 +++- python/examples/ola_candidate_ports.py | 4 ++- python/examples/ola_devices.py | 4 ++- python/examples/ola_fetch_dmx.py | 6 ++-- python/examples/ola_patch_unpatch.py | 6 ++-- python/examples/ola_plugin_info.py | 6 ++-- python/examples/ola_rdm_discover.py | 4 ++- python/examples/ola_rdm_get.py | 5 +++- python/examples/ola_recv_dmx.py | 3 +- python/examples/ola_send_dmx.py | 4 ++- python/examples/ola_simple_fade.py | 5 ++-- python/examples/ola_universe_info.py | 4 ++- python/examples/rdm_compare.py | 1 + python/examples/rdm_snapshot.py | 4 ++- python/ola/ClientWrapper.py | 1 + python/ola/ClientWrapperTest.py | 5 ++-- python/ola/DUBDecoder.py | 1 + python/ola/DUBDecoderTest.py | 1 + python/ola/MACAddressTest.py | 3 +- python/ola/OlaClient.py | 6 ++-- python/ola/OlaClientTest.py | 5 ++-- python/ola/PidStore.py | 7 +++-- python/ola/PidStoreTest.py | 3 +- python/ola/RDMAPI.py | 3 ++ python/ola/RDMTest.py | 5 ++-- python/ola/UIDTest.py | 3 +- python/ola/rpc/SimpleRpcControllerTest.py | 1 + python/ola/rpc/StreamRpcChannel.py | 1 + scripts/enforce_licence.py | 1 + scripts/verify_trees.py | 4 +-- tools/ola_mon/ola_mon.py | 6 ++-- tools/rdm/ExpectedResultsTest.py | 6 ++-- tools/rdm/ModelCollector.py | 5 +++- tools/rdm/ResponderTest.py | 4 ++- tools/rdm/ResponderTestTest.py | 3 +- tools/rdm/TestDefinitions.py | 35 ++++++++++++----------- tools/rdm/TestHelpersTest.py | 1 + tools/rdm/TestLogger.py | 2 +- tools/rdm/TestMixins.py | 12 ++++---- tools/rdm/TestRunner.py | 6 ++-- tools/rdm/TestStateTest.py | 3 +- tools/rdm/TimingStats.py | 1 + tools/rdm/launch_tests.py | 6 ++-- tools/rdm/rdm_model_collector.py | 7 +++-- tools/rdm/rdm_responder_test.py | 16 ++++++----- tools/rdm/rdm_test_server.py | 14 ++++----- tools/rdm/setup_patch.py | 2 ++ 49 files changed, 157 insertions(+), 85 deletions(-) diff --git a/data/rdm/PidDataTest.py b/data/rdm/PidDataTest.py index 5268286719..f92a53f029 100755 --- a/data/rdm/PidDataTest.py +++ b/data/rdm/PidDataTest.py @@ -20,6 +20,7 @@ import os import unittest + from ola import PidStore __author__ = 'nomis52@gmail.com (Simon Newton)' diff --git a/include/ola/gen_callbacks.py b/include/ola/gen_callbacks.py index ba530c929f..18f149df89 100755 --- a/include/ola/gen_callbacks.py +++ b/include/ola/gen_callbacks.py @@ -18,6 +18,7 @@ from __future__ import print_function + import textwrap diff --git a/python/examples/ola_artnet_params.py b/python/examples/ola_artnet_params.py index af0955e082..5aad994fdd 100755 --- a/python/examples/ola_artnet_params.py +++ b/python/examples/ola_artnet_params.py @@ -19,9 +19,12 @@ """Fetch some ArtNet parameters.""" from __future__ import print_function + +import sys + from ola.ClientWrapper import ClientWrapper + from ola import ArtNetConfigMessages_pb2 -import sys __author__ = 'nomis52@gmail.com (Simon Newton)' diff --git a/python/examples/ola_candidate_ports.py b/python/examples/ola_candidate_ports.py index 3b1d4cf683..6ca56bcdf4 100755 --- a/python/examples/ola_candidate_ports.py +++ b/python/examples/ola_candidate_ports.py @@ -19,10 +19,12 @@ """List candidate ports for patching.""" from __future__ import print_function -from ola.ClientWrapper import ClientWrapper + import argparse import sys +from ola.ClientWrapper import ClientWrapper + __author__ = 'simon.marchi@polymtl.ca (Simon Marchi)' wrapper = None diff --git a/python/examples/ola_devices.py b/python/examples/ola_devices.py index d9832ef80e..ead9cc8634 100755 --- a/python/examples/ola_devices.py +++ b/python/examples/ola_devices.py @@ -19,9 +19,11 @@ """Lists the devices / ports.""" from __future__ import print_function -from ola.ClientWrapper import ClientWrapper + import sys +from ola.ClientWrapper import ClientWrapper + __author__ = 'nomis52@gmail.com (Simon Newton)' wrapper = None diff --git a/python/examples/ola_fetch_dmx.py b/python/examples/ola_fetch_dmx.py index 1b166b0176..cb05c0a626 100755 --- a/python/examples/ola_fetch_dmx.py +++ b/python/examples/ola_fetch_dmx.py @@ -19,10 +19,12 @@ """Gets a current frame of DMX for a universe.""" from __future__ import print_function -from ola.ClientWrapper import ClientWrapper + import getopt -import textwrap import sys +import textwrap + +from ola.ClientWrapper import ClientWrapper __author__ = 'nomis52@gmail.com (Simon Newton)' diff --git a/python/examples/ola_patch_unpatch.py b/python/examples/ola_patch_unpatch.py index a2a9ec4ff6..19aa2667e7 100755 --- a/python/examples/ola_patch_unpatch.py +++ b/python/examples/ola_patch_unpatch.py @@ -19,11 +19,13 @@ """Patch and unpatch ports.""" from __future__ import print_function -from ola.ClientWrapper import ClientWrapper -from ola.OlaClient import OlaClient + import argparse import sys +from ola.ClientWrapper import ClientWrapper +from ola.OlaClient import OlaClient + __author__ = 'simon.marchi@polymtl.ca (Simon Marchi)' wrapper = None diff --git a/python/examples/ola_plugin_info.py b/python/examples/ola_plugin_info.py index b85506f96f..74aa6dd935 100755 --- a/python/examples/ola_plugin_info.py +++ b/python/examples/ola_plugin_info.py @@ -19,10 +19,12 @@ """Lists the loaded plugins.""" from __future__ import print_function -from ola.ClientWrapper import ClientWrapper + import getopt -import textwrap import sys +import textwrap + +from ola.ClientWrapper import ClientWrapper __author__ = 'nomis52@gmail.com (Simon Newton)' diff --git a/python/examples/ola_rdm_discover.py b/python/examples/ola_rdm_discover.py index 4c84a04ebf..32846428d1 100755 --- a/python/examples/ola_rdm_discover.py +++ b/python/examples/ola_rdm_discover.py @@ -19,9 +19,11 @@ '''Show the UIDs for a universe.''' from __future__ import print_function + import getopt -import textwrap import sys +import textwrap + from ola.ClientWrapper import ClientWrapper __author__ = 'nomis52@gmail.com (Simon Newton)' diff --git a/python/examples/ola_rdm_get.py b/python/examples/ola_rdm_get.py index 009ea7da8e..606b584ac6 100755 --- a/python/examples/ola_rdm_get.py +++ b/python/examples/ola_rdm_get.py @@ -19,18 +19,21 @@ '''Get a PID from a UID.''' from __future__ import print_function + import cmd import getopt import os.path import readline import sys import textwrap -from ola import PidStore + from ola.ClientWrapper import ClientWrapper from ola.OlaClient import OlaClient, RDMNack from ola.RDMAPI import RDMAPI from ola.UID import UID +from ola import PidStore + __author__ = 'nomis52@gmail.com (Simon Newton)' diff --git a/python/examples/ola_recv_dmx.py b/python/examples/ola_recv_dmx.py index 6f1abdf100..9fb578b4c8 100755 --- a/python/examples/ola_recv_dmx.py +++ b/python/examples/ola_recv_dmx.py @@ -19,8 +19,9 @@ """Receive DMX data.""" import getopt -import textwrap import sys +import textwrap + from ola.ClientWrapper import ClientWrapper __author__ = 'nomis52@gmail.com (Simon Newton)' diff --git a/python/examples/ola_send_dmx.py b/python/examples/ola_send_dmx.py index 3adeb0ec78..df43dae624 100755 --- a/python/examples/ola_send_dmx.py +++ b/python/examples/ola_send_dmx.py @@ -19,10 +19,12 @@ """Send some DMX data.""" from __future__ import print_function -from ola.ClientWrapper import ClientWrapper + import array import sys +from ola.ClientWrapper import ClientWrapper + __author__ = 'nomis52@gmail.com (Simon Newton)' wrapper = None diff --git a/python/examples/ola_simple_fade.py b/python/examples/ola_simple_fade.py index d9ef3184df..e2d93c4c4e 100755 --- a/python/examples/ola_simple_fade.py +++ b/python/examples/ola_simple_fade.py @@ -17,9 +17,10 @@ # Copyright (C) 2014 Sean Sill from array import array + from ola.ClientWrapper import ClientWrapper -from ola.DMXConstants import DMX_MIN_SLOT_VALUE, DMX_MAX_SLOT_VALUE, \ - DMX_UNIVERSE_SIZE +from ola.DMXConstants import (DMX_MAX_SLOT_VALUE, DMX_MIN_SLOT_VALUE, + DMX_UNIVERSE_SIZE) __author__ = 'Sean Sill' diff --git a/python/examples/ola_universe_info.py b/python/examples/ola_universe_info.py index cc62175e53..7fb7c87379 100755 --- a/python/examples/ola_universe_info.py +++ b/python/examples/ola_universe_info.py @@ -19,9 +19,11 @@ """Lists the active universes.""" from __future__ import print_function + +import sys + from ola.ClientWrapper import ClientWrapper from ola.OlaClient import Universe -import sys __author__ = 'nomis52@gmail.com (Simon Newton)' diff --git a/python/examples/rdm_compare.py b/python/examples/rdm_compare.py index 6aba073be0..633459e001 100755 --- a/python/examples/rdm_compare.py +++ b/python/examples/rdm_compare.py @@ -23,6 +23,7 @@ import tempfile import textwrap import webbrowser + from ola.UID import UID '''Compare the RDM configurations saves with rdm_snapshot.py''' diff --git a/python/examples/rdm_snapshot.py b/python/examples/rdm_snapshot.py index 088dd70f9c..30ba4e9694 100755 --- a/python/examples/rdm_snapshot.py +++ b/python/examples/rdm_snapshot.py @@ -22,12 +22,14 @@ import pprint import sys import textwrap -from ola import PidStore + from ola.ClientWrapper import ClientWrapper from ola.OlaClient import OlaClient, RDMNack from ola.RDMAPI import RDMAPI from ola.UID import UID +from ola import PidStore + '''Quick script to collect the settings from a rig.''' __author__ = 'nomis52@gmail.com (Simon Newton)' diff --git a/python/ola/ClientWrapper.py b/python/ola/ClientWrapper.py index e9fc3309ad..f302e0318c 100644 --- a/python/ola/ClientWrapper.py +++ b/python/ola/ClientWrapper.py @@ -25,6 +25,7 @@ import termios import threading import traceback + from ola.OlaClient import OlaClient """A simple client wrapper for the OlaClient.""" diff --git a/python/ola/ClientWrapperTest.py b/python/ola/ClientWrapperTest.py index 00c86caf7f..d4252c7bb7 100644 --- a/python/ola/ClientWrapperTest.py +++ b/python/ola/ClientWrapperTest.py @@ -22,10 +22,9 @@ import socket # import timeout_decorator import unittest -from ola.ClientWrapper import ClientWrapper -from ola.ClientWrapper import _Event -from ola.TestUtils import handleRPCByteOrder +from ola.ClientWrapper import ClientWrapper, _Event +from ola.TestUtils import handleRPCByteOrder """Test cases for the Event and Event loop of ClientWrapper class.""" diff --git a/python/ola/DUBDecoder.py b/python/ola/DUBDecoder.py index 28f78e0819..736aae1c22 100644 --- a/python/ola/DUBDecoder.py +++ b/python/ola/DUBDecoder.py @@ -16,6 +16,7 @@ # Copyright (C) 2012 Simon Newton import itertools + from ola.UID import UID """Decodes a DUB response.""" diff --git a/python/ola/DUBDecoderTest.py b/python/ola/DUBDecoderTest.py index a93d753949..a102945458 100755 --- a/python/ola/DUBDecoderTest.py +++ b/python/ola/DUBDecoderTest.py @@ -17,6 +17,7 @@ # Copyright (C) Simon Newton import unittest + from ola.DUBDecoder import DecodeResponse """Test cases for the DUBDecoder class.""" diff --git a/python/ola/MACAddressTest.py b/python/ola/MACAddressTest.py index 26b9ff670c..6bd05a6769 100755 --- a/python/ola/MACAddressTest.py +++ b/python/ola/MACAddressTest.py @@ -18,8 +18,9 @@ import sys import unittest + from ola.MACAddress import MACAddress -from ola.TestUtils import allNotEqual, allHashNotEqual +from ola.TestUtils import allHashNotEqual, allNotEqual """Test cases for the MACAddress class.""" diff --git a/python/ola/OlaClient.py b/python/ola/OlaClient.py index 6d1fb32c6d..47e8dfa41c 100644 --- a/python/ola/OlaClient.py +++ b/python/ola/OlaClient.py @@ -19,11 +19,13 @@ import socket import struct import sys -from ola.rpc.StreamRpcChannel import StreamRpcChannel + from ola.rpc.SimpleRpcController import SimpleRpcController -from ola import Ola_pb2 +from ola.rpc.StreamRpcChannel import StreamRpcChannel from ola.UID import UID +from ola import Ola_pb2 + """The client used to communicate with the Ola Server.""" __author__ = 'nomis52@gmail.com (Simon Newton)' diff --git a/python/ola/OlaClientTest.py b/python/ola/OlaClientTest.py index 9e7dfebab5..9cbe098d33 100644 --- a/python/ola/OlaClientTest.py +++ b/python/ola/OlaClientTest.py @@ -17,8 +17,9 @@ # Copyright (C) 2019 Bruce Lowekamp import unittest -from ola.OlaClient import Plugin, Device, Port, Universe, RDMNack -from ola.TestUtils import allNotEqual, allHashNotEqual + +from ola.OlaClient import Device, Plugin, Port, RDMNack, Universe +from ola.TestUtils import allHashNotEqual, allNotEqual """Test cases for data structures of OlaClient. SendDMX is tested with ClientWrapper.""" diff --git a/python/ola/PidStore.py b/python/ola/PidStore.py index 7812d60807..bf50dd616b 100644 --- a/python/ola/PidStore.py +++ b/python/ola/PidStore.py @@ -17,19 +17,20 @@ # Holds all the information about RDM PIDs from __future__ import print_function + import binascii import math import os import socket import struct import sys + from google.protobuf import text_format -from ola import PidStoreLocation -from ola import Pids_pb2 from ola.MACAddress import MACAddress -from ola import RDMConstants from ola.UID import UID +from ola import Pids_pb2, PidStoreLocation, RDMConstants + """The PID Store.""" __author__ = 'nomis52@gmail.com (Simon Newton)' diff --git a/python/ola/PidStoreTest.py b/python/ola/PidStoreTest.py index 9b6a832a0d..b928024648 100755 --- a/python/ola/PidStoreTest.py +++ b/python/ola/PidStoreTest.py @@ -19,8 +19,9 @@ import binascii import os import unittest + import ola.PidStore as PidStore -from ola.TestUtils import allNotEqual, allHashNotEqual +from ola.TestUtils import allHashNotEqual, allNotEqual """Test cases for the PidStore class. Relies on the PID data from RDM tests in the directory diff --git a/python/ola/RDMAPI.py b/python/ola/RDMAPI.py index 2686dcacb8..e02ca7077c 100644 --- a/python/ola/RDMAPI.py +++ b/python/ola/RDMAPI.py @@ -16,8 +16,11 @@ # Copyright (C) 2010 Simon Newton from __future__ import print_function + import sys + from ola.OlaClient import OlaClient + from ola import PidStore """The Python RDM API.""" diff --git a/python/ola/RDMTest.py b/python/ola/RDMTest.py index cfbf486e3c..36bd74ff3a 100644 --- a/python/ola/RDMTest.py +++ b/python/ola/RDMTest.py @@ -21,13 +21,14 @@ import socket # import timeout_decorator import unittest -from ola import PidStore + from ola.ClientWrapper import ClientWrapper from ola.OlaClient import RDMNack from ola.RDMAPI import RDMAPI -from ola.UID import UID from ola.TestUtils import handleRPCByteOrder +from ola.UID import UID +from ola import PidStore """Test cases for RDM device commands.""" diff --git a/python/ola/UIDTest.py b/python/ola/UIDTest.py index 9b7f0b6017..0e71af2ce1 100755 --- a/python/ola/UIDTest.py +++ b/python/ola/UIDTest.py @@ -17,8 +17,9 @@ # Copyright (C) 2005 Simon Newton import unittest + +from ola.TestUtils import allHashNotEqual, allNotEqual from ola.UID import UID, UIDOutOfRangeException -from ola.TestUtils import allNotEqual, allHashNotEqual """Test cases for the UID class.""" diff --git a/python/ola/rpc/SimpleRpcControllerTest.py b/python/ola/rpc/SimpleRpcControllerTest.py index 78dc91bff1..7f1d2988d7 100755 --- a/python/ola/rpc/SimpleRpcControllerTest.py +++ b/python/ola/rpc/SimpleRpcControllerTest.py @@ -17,6 +17,7 @@ # Copyright (C) 2005 Simon Newton import unittest + from SimpleRpcController import SimpleRpcController """Test cases for the SimpleRpcController.""" diff --git a/python/ola/rpc/StreamRpcChannel.py b/python/ola/rpc/StreamRpcChannel.py index d4ddd9178b..ffbfe71ba6 100644 --- a/python/ola/rpc/StreamRpcChannel.py +++ b/python/ola/rpc/StreamRpcChannel.py @@ -18,6 +18,7 @@ import binascii import logging import struct + from google.protobuf import service from ola.rpc import Rpc_pb2 from ola.rpc.SimpleRpcController import SimpleRpcController diff --git a/scripts/enforce_licence.py b/scripts/enforce_licence.py index 9c930f73fe..b15d157681 100755 --- a/scripts/enforce_licence.py +++ b/scripts/enforce_licence.py @@ -17,6 +17,7 @@ # Copyright (C) 2013 Simon Newton from __future__ import print_function + import difflib import getopt import glob diff --git a/scripts/verify_trees.py b/scripts/verify_trees.py index c4a8d114e2..b1cc9b2c8b 100755 --- a/scripts/verify_trees.py +++ b/scripts/verify_trees.py @@ -18,10 +18,10 @@ from __future__ import print_function -import os import fnmatch -import textwrap +import os import sys +import textwrap # File & directory patterns that differ between what's in the git repo and # what's in the tarball. diff --git a/tools/ola_mon/ola_mon.py b/tools/ola_mon/ola_mon.py index 00e1b81907..cc9cac53ee 100755 --- a/tools/ola_mon/ola_mon.py +++ b/tools/ola_mon/ola_mon.py @@ -20,15 +20,17 @@ # doesn't stop from __future__ import print_function + import getopt -import rrdtool -import time import os.path import re import socket import sys import textwrap import threading +import time + +import rrdtool if sys.version_info >= (3, 0): try: diff --git a/tools/rdm/ExpectedResultsTest.py b/tools/rdm/ExpectedResultsTest.py index c30544813b..27b6512853 100644 --- a/tools/rdm/ExpectedResultsTest.py +++ b/tools/rdm/ExpectedResultsTest.py @@ -17,10 +17,12 @@ # Copyright (C) 2021 Peter Newman import unittest +from collections import namedtuple + from ExpectedResults import (BroadcastResult, DUBResult, InvalidResponse, - TimeoutResult, SuccessfulResult, UnsupportedResult) + SuccessfulResult, TimeoutResult, + UnsupportedResult) from ola.OlaClient import OlaClient -from collections import namedtuple """Test cases for ExpectedResults classes.""" diff --git a/tools/rdm/ModelCollector.py b/tools/rdm/ModelCollector.py index 4ea6f9a1ae..9d0b761ab5 100644 --- a/tools/rdm/ModelCollector.py +++ b/tools/rdm/ModelCollector.py @@ -16,12 +16,15 @@ # Copyright (C) 2011 Simon Newton from __future__ import print_function + import logging + import ola.RDMConstants -from ola import PidStore from ola.OlaClient import OlaClient, RDMNack from ola.RDMAPI import RDMAPI +from ola import PidStore + '''Quick script to collect information about responders.''' __author__ = 'nomis52@gmail.com (Simon Newton)' diff --git a/tools/rdm/ResponderTest.py b/tools/rdm/ResponderTest.py index 2cad724c95..a059a03185 100644 --- a/tools/rdm/ResponderTest.py +++ b/tools/rdm/ResponderTest.py @@ -27,13 +27,15 @@ import logging import sys import time + from ExpectedResults import (AckDiscoveryResult, AckGetResult, AckSetResult, NackDiscoveryResult, NackGetResult, NackSetResult) +from ola.OlaClient import OlaClient, RDMNack from TestCategory import TestCategory from TestState import TestState from TimingStats import TimingStats + from ola import PidStore -from ola.OlaClient import OlaClient, RDMNack if sys.version_info >= (3, 0): try: diff --git a/tools/rdm/ResponderTestTest.py b/tools/rdm/ResponderTestTest.py index 8bd771666d..0caa499c3a 100644 --- a/tools/rdm/ResponderTestTest.py +++ b/tools/rdm/ResponderTestTest.py @@ -17,7 +17,8 @@ # Copyright (C) 2019 Bruce Lowekamp import unittest -from ResponderTest import TestFixture, ResponderTestFixture + +from ResponderTest import ResponderTestFixture, TestFixture """Test cases for sorting TestFixtures.""" diff --git a/tools/rdm/TestDefinitions.py b/tools/rdm/TestDefinitions.py index 5e97ed16d9..0f23a783fb 100644 --- a/tools/rdm/TestDefinitions.py +++ b/tools/rdm/TestDefinitions.py @@ -18,29 +18,30 @@ import datetime import operator import struct -from ExpectedResults import (AckGetResult, BroadcastResult, NackGetResult, - InvalidResponse, TimeoutResult, UnsupportedResult, - RDM_GET, RDM_SET) -from ResponderTest import ResponderTestFixture, TestFixture -from ResponderTest import OptionalParameterTestFixture -from TestCategory import TestCategory -from ola import PidStore -from ola import RDMConstants -from ola.RDMConstants import (RDM_MIN_HOSTNAME_LENGTH, RDM_MAX_HOSTNAME_LENGTH, - RDM_MAX_DOMAIN_NAME_LENGTH, - RDM_MANUFACTURER_PID_MIN, - RDM_MANUFACTURER_PID_MAX, RDM_INTERFACE_INDEX_MIN, - RDM_INTERFACE_INDEX_MAX, - INTERFACE_HARDWARE_TYPE_ETHERNET, - RDM_ZERO_FOOTPRINT_DMX_ADDRESS, - RDM_MANUFACTURER_SD_MIN, RDM_MANUFACTURER_SD_MAX) + +import TestMixins +from ExpectedResults import (RDM_GET, RDM_SET, AckGetResult, BroadcastResult, + InvalidResponse, NackGetResult, TimeoutResult, + UnsupportedResult) from ola.OlaClient import OlaClient, RDMNack from ola.PidStore import ROOT_DEVICE +from ola.RDMConstants import (INTERFACE_HARDWARE_TYPE_ETHERNET, + RDM_INTERFACE_INDEX_MAX, RDM_INTERFACE_INDEX_MIN, + RDM_MANUFACTURER_PID_MAX, + RDM_MANUFACTURER_PID_MIN, + RDM_MANUFACTURER_SD_MAX, RDM_MANUFACTURER_SD_MIN, + RDM_MAX_DOMAIN_NAME_LENGTH, + RDM_MAX_HOSTNAME_LENGTH, RDM_MIN_HOSTNAME_LENGTH, + RDM_ZERO_FOOTPRINT_DMX_ADDRESS) from ola.UID import UID +from ResponderTest import (OptionalParameterTestFixture, ResponderTestFixture, + TestFixture) +from TestCategory import TestCategory from TestHelpers import ContainsUnprintable -import TestMixins from TestMixins import MAX_DMX_ADDRESS +from ola import PidStore, RDMConstants + '''This defines all the tests for RDM responders.''' __author__ = 'nomis52@gmail.com (Simon Newton)' diff --git a/tools/rdm/TestHelpersTest.py b/tools/rdm/TestHelpersTest.py index 98434bd27e..61d734fcde 100644 --- a/tools/rdm/TestHelpersTest.py +++ b/tools/rdm/TestHelpersTest.py @@ -17,6 +17,7 @@ # Copyright (C) 2021 Peter Newman import unittest + from TestHelpers import ContainsUnprintable """Test cases for TestHelpers utilities.""" diff --git a/tools/rdm/TestLogger.py b/tools/rdm/TestLogger.py index e53e6baa71..e1a7269e90 100644 --- a/tools/rdm/TestLogger.py +++ b/tools/rdm/TestLogger.py @@ -20,9 +20,9 @@ import pickle import re -from ola import Version from ola.testing.rdm.TestState import TestState +from ola import Version __author__ = 'nomis52@gmail.com (Simon Newton)' diff --git a/tools/rdm/TestMixins.py b/tools/rdm/TestMixins.py index c8af6607c1..625d2ddadf 100644 --- a/tools/rdm/TestMixins.py +++ b/tools/rdm/TestMixins.py @@ -16,19 +16,21 @@ # Copyright (C) 2010 Simon Newton import struct -from ExpectedResults import (AckGetResult, AckDiscoveryResult, BroadcastResult, + +from ExpectedResults import (AckDiscoveryResult, AckGetResult, BroadcastResult, DUBResult, NackSetResult, TimeoutResult, UnsupportedResult) -from ResponderTest import ResponderTestFixture -from TestCategory import TestCategory -from TestHelpers import ContainsUnprintable -from ola import PidStore from ola.DMXConstants import DMX_UNIVERSE_SIZE from ola.DUBDecoder import DecodeResponse from ola.OlaClient import OlaClient, RDMNack from ola.PidStore import ROOT_DEVICE from ola.RDMConstants import RDM_MAX_STRING_LENGTH from ola.UID import UID +from ResponderTest import ResponderTestFixture +from TestCategory import TestCategory +from TestHelpers import ContainsUnprintable + +from ola import PidStore '''Mixins used by the test definitions. diff --git a/tools/rdm/TestRunner.py b/tools/rdm/TestRunner.py index a611c9a984..1e76908dfc 100644 --- a/tools/rdm/TestRunner.py +++ b/tools/rdm/TestRunner.py @@ -19,11 +19,13 @@ import inspect import logging import time -from TimingStats import TimingStats -from ola import PidStore + from ola.OlaClient import OlaClient, RDMNack from ola.RDMAPI import RDMAPI from ola.testing.rdm import ResponderTest +from TimingStats import TimingStats + +from ola import PidStore __author__ = 'nomis52@gmail.com (Simon Newton)' diff --git a/tools/rdm/TestStateTest.py b/tools/rdm/TestStateTest.py index 636d548306..9e3aa26962 100644 --- a/tools/rdm/TestStateTest.py +++ b/tools/rdm/TestStateTest.py @@ -17,8 +17,9 @@ # Copyright (C) 2019 Bruce Lowekamp import unittest + +from ola.TestUtils import allHashNotEqual, allNotEqual from TestState import TestState -from ola.TestUtils import allNotEqual, allHashNotEqual """Test cases for sorting TestState.""" diff --git a/tools/rdm/TimingStats.py b/tools/rdm/TimingStats.py index 1fcc0bbf42..67974b6de2 100644 --- a/tools/rdm/TimingStats.py +++ b/tools/rdm/TimingStats.py @@ -16,6 +16,7 @@ # Copyright (C) 2015 Simon Newton import logging + import numpy from ola.OlaClient import OlaClient diff --git a/tools/rdm/launch_tests.py b/tools/rdm/launch_tests.py index 2ef9aacc93..b1b8a16405 100755 --- a/tools/rdm/launch_tests.py +++ b/tools/rdm/launch_tests.py @@ -17,10 +17,9 @@ # Copyright (C) 2012 Simon Newton from __future__ import print_function -from optparse import OptionParser + import logging import os -import setup_patch # The Port Autopatcher import shutil import signal import subprocess @@ -28,6 +27,9 @@ import tempfile import textwrap import time +from optparse import OptionParser + +import setup_patch # The Port Autopatcher """ Launch the OLA RDM test environment. diff --git a/tools/rdm/rdm_model_collector.py b/tools/rdm/rdm_model_collector.py index f9d6b7ca74..c37e1bbd4e 100755 --- a/tools/rdm/rdm_model_collector.py +++ b/tools/rdm/rdm_model_collector.py @@ -17,14 +17,17 @@ # Copyright (C) 2011 Simon Newton from __future__ import print_function + import getopt import logging import pprint import sys import textwrap -from ola import PidStore -from ola.testing.rdm.ModelCollector import ModelCollector + from ola.ClientWrapper import ClientWrapper +from ola.testing.rdm.ModelCollector import ModelCollector + +from ola import PidStore '''Quick script to collect information about responders.''' diff --git a/tools/rdm/rdm_responder_test.py b/tools/rdm/rdm_responder_test.py index 3e24d1672c..f9bc5882f8 100755 --- a/tools/rdm/rdm_responder_test.py +++ b/tools/rdm/rdm_responder_test.py @@ -17,21 +17,23 @@ # Copyright (C) 2010 Simon Newton from __future__ import print_function -from ola.testing.rdm import TestDefinitions, TestRunner -from ola.testing.rdm.DMXSender import DMXSender -from ola.testing.rdm.TestState import TestState -from ola.testing.rdm.TimingStats import TimingStats + import datetime import logging import re import sys import textwrap import time -from ola import PidStore -from ola import Version +from optparse import OptionParser + from ola.ClientWrapper import ClientWrapper +from ola.testing.rdm import TestDefinitions, TestRunner +from ola.testing.rdm.DMXSender import DMXSender +from ola.testing.rdm.TestState import TestState +from ola.testing.rdm.TimingStats import TimingStats from ola.UID import UID -from optparse import OptionParser + +from ola import PidStore, Version if sys.version_info >= (3, 0): try: diff --git a/tools/rdm/rdm_test_server.py b/tools/rdm/rdm_test_server.py index ad56766123..1235e66cd0 100755 --- a/tools/rdm/rdm_test_server.py +++ b/tools/rdm/rdm_test_server.py @@ -17,6 +17,7 @@ # Copyright (C) 2012 Ravindra Nath Kakarla & Simon Newton from __future__ import print_function + import json import logging import mimetypes @@ -27,23 +28,22 @@ import sys import textwrap import traceback - from datetime import datetime from optparse import OptionParser from threading import Condition, Event, Lock, Thread from time import time from wsgiref.simple_server import make_server -from ola.UID import UID + from ola.ClientWrapper import ClientWrapper, SelectServer from ola.OlaClient import OlaClient, OLADNotRunningException -from ola import PidStore +from ola.testing.rdm import (DataLocation, TestDefinitions, TestLogger, + TestRunner) from ola.testing.rdm.DMXSender import DMXSender -from ola.testing.rdm import DataLocation -from ola.testing.rdm import TestDefinitions -from ola.testing.rdm import TestLogger -from ola.testing.rdm import TestRunner from ola.testing.rdm.ModelCollector import ModelCollector from ola.testing.rdm.TestState import TestState +from ola.UID import UID + +from ola import PidStore try: import urllib.parse as urlparse diff --git a/tools/rdm/setup_patch.py b/tools/rdm/setup_patch.py index 2b0c6c6a38..051505508b 100755 --- a/tools/rdm/setup_patch.py +++ b/tools/rdm/setup_patch.py @@ -17,7 +17,9 @@ # Copyright (C) 2012 Simon Newton from __future__ import print_function + import logging + from ola.ClientWrapper import ClientWrapper from ola.OlaClient import OlaClient, Plugin