From 70e481c776e3acde2778f504251748311044c9ab Mon Sep 17 00:00:00 2001 From: jan iversen Date: Mon, 6 Jan 2025 12:27:40 +0100 Subject: [PATCH] Step. --- pymodbus/simulator/__init__.py | 6 +++--- pymodbus/simulator/{simregconfig.py => simdata.py} | 11 +++++------ test/examples/__init__.py | 1 - test/framer/__init__.py | 1 - test/framer/test_framer.py | 3 +-- test/pdu/__init__.py | 1 - test/pdu/test_register_write_messages.py | 3 +-- test/simulator/test_simdata.py | 5 +++++ test/transport/__init__.py | 1 - 9 files changed, 15 insertions(+), 17 deletions(-) rename pymodbus/simulator/{simregconfig.py => simdata.py} (80%) delete mode 100644 test/examples/__init__.py delete mode 100644 test/framer/__init__.py delete mode 100644 test/pdu/__init__.py create mode 100644 test/simulator/test_simdata.py delete mode 100644 test/transport/__init__.py diff --git a/pymodbus/simulator/__init__.py b/pymodbus/simulator/__init__.py index 3d7a2e775..371368326 100644 --- a/pymodbus/simulator/__init__.py +++ b/pymodbus/simulator/__init__.py @@ -1,9 +1,9 @@ """Simulator.""" __all__ = [ - "SimulatorRegisterConfig", + "SimulatorData", ] -from pymodbus.simulator.simregconfig import ( - SimulatorRegisterConfig, +from pymodbus.simulator.simdata import ( + SimulatorData, ) diff --git a/pymodbus/simulator/simregconfig.py b/pymodbus/simulator/simdata.py similarity index 80% rename from pymodbus/simulator/simregconfig.py rename to pymodbus/simulator/simdata.py index 0cf38fcd9..f717a8e82 100644 --- a/pymodbus/simulator/simregconfig.py +++ b/pymodbus/simulator/simdata.py @@ -4,10 +4,10 @@ from enum import Enum -class SimulatorRegisterConfig: +class SimulatorData: # pylint: disable=too-few-public-methods """Configure a set of registers.""" - class REGISTERTYPE(Enum): + class TYPE(Enum): """Register types, used to define group of registers.""" INT16 = 1 @@ -22,7 +22,7 @@ class REGISTERTYPE(Enum): BITS = 10 REGISTERS = 11 - class REGISTERBLOCK(Enum): + class BLOCK(Enum): """Define the block to which a register group belongs.""" SHARED = 0 @@ -34,11 +34,10 @@ class REGISTERBLOCK(Enum): def __init__(self, start_register: int, - datatype: REGISTERTYPE, + datatype: TYPE, count: int, *, action=None, - block: REGISTERBLOCK = REGISTERBLOCK.SHARED + block: BLOCK = BLOCK.SHARED ): """Define a group of registers.""" - pass diff --git a/test/examples/__init__.py b/test/examples/__init__.py deleted file mode 100644 index 5f2eb76e0..000000000 --- a/test/examples/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Test of examples.""" diff --git a/test/framer/__init__.py b/test/framer/__init__.py deleted file mode 100644 index 6120f1a8f..000000000 --- a/test/framer/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Test of message layer.""" diff --git a/test/framer/test_framer.py b/test/framer/test_framer.py index a07ceed03..15ea4ce60 100644 --- a/test/framer/test_framer.py +++ b/test/framer/test_framer.py @@ -12,8 +12,7 @@ FramerType, ) from pymodbus.pdu import DecodePDU, ModbusPDU - -from .generator import set_calls +from test.framer.generator import set_calls class TestFramer: diff --git a/test/pdu/__init__.py b/test/pdu/__init__.py deleted file mode 100644 index 6120f1a8f..000000000 --- a/test/pdu/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Test of message layer.""" diff --git a/test/pdu/test_register_write_messages.py b/test/pdu/test_register_write_messages.py index 239abbfe2..1dd4cf08d 100644 --- a/test/pdu/test_register_write_messages.py +++ b/test/pdu/test_register_write_messages.py @@ -9,8 +9,7 @@ WriteSingleRegisterRequest, WriteSingleRegisterResponse, ) - -from ..conftest import MockLastValuesContext +from test.conftest import MockLastValuesContext # ---------------------------------------------------------------------------# diff --git a/test/simulator/test_simdata.py b/test/simulator/test_simdata.py new file mode 100644 index 000000000..302b23190 --- /dev/null +++ b/test/simulator/test_simdata.py @@ -0,0 +1,5 @@ +"""Test pdu.""" + + +class TestSimData: + """Test simulator data config.""" diff --git a/test/transport/__init__.py b/test/transport/__init__.py deleted file mode 100644 index 430da4624..000000000 --- a/test/transport/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Test of transport layer."""