python3Packages.async-modbus: 0.2.0 -> 0.2.1

This commit is contained in:
Martin Weinelt 2022-12-30 20:12:55 +01:00
parent 048bf8acc5
commit 3396b16c4e
2 changed files with 84 additions and 2 deletions

View File

@ -2,6 +2,7 @@
, buildPythonPackage
, connio
, fetchFromGitHub
, fetchpatch
, pytest-asyncio
, pytestCheckHook
, pythonOlder
@ -11,7 +12,7 @@
buildPythonPackage rec {
pname = "async-modbus";
version = "0.2.0";
version = "0.2.1";
format = "pyproject";
disabled = pythonOlder "3.7";
@ -20,9 +21,17 @@ buildPythonPackage rec {
owner = "tiagocoutinho";
repo = "async_modbus";
rev = "refs/tags/v${version}";
hash = "sha256-TB+ndUvLZ9G3XXEBpLb4ULHlYZC2CoqGnL2BjMQrhRg=";
hash = "sha256-OTt/rUa3KLVSFOIUyMNHnqHvPtISxTposNFAgoixRfk=";
};
patches = [
(fetchpatch {
# Fix tests; https://github.com/tiagocoutinho/async_modbus/pull/13
url = "https://github.com/tiagocoutinho/async_modbus/commit/d81d8ffe94870f0f505e0c8a0694768c98053ecc.patch";
hash = "sha256-mG3XO2nAFYitatkswU7er29BJc/A0IL1rL2Zu4daZ7k=";
})
];
postPatch = ''
substituteInPlace pyproject.toml \
--replace '"--cov=async_modbus",' "" \

View File

@ -0,0 +1,73 @@
diff --git a/tests/test_async_modbus.py b/tests/test_async_modbus.py
index b0bd3fd..6b8df87 100644
--- a/tests/test_async_modbus.py
+++ b/tests/test_async_modbus.py
@@ -194,7 +194,7 @@ async def test_read_coils(proto, slave_id, starting_address, expected_reply):
await coro
else:
reply = await coro
- assert (reply == expected_reply).all()
+ assert reply == expected_reply
server = Server(slave_id, starting_address, expected_reply)
client = AsyncClient(server, protocol)
@@ -204,7 +204,7 @@ async def test_read_coils(proto, slave_id, starting_address, expected_reply):
await coro
else:
reply = await coro
- assert (reply == expected_reply).all()
+ assert reply == expected_reply
@pytest.mark.asyncio
@@ -273,7 +273,7 @@ async def test_read_discrete_inputs(proto, slave_id, starting_address, expected_
await coro
else:
reply = await coro
- assert (reply == expected_reply).all()
+ assert reply == expected_reply
server = Server(slave_id, starting_address, expected_reply)
client = AsyncClient(server, protocol)
@@ -283,7 +283,7 @@ async def test_read_discrete_inputs(proto, slave_id, starting_address, expected_
await coro
else:
reply = await coro
- assert (reply == expected_reply).all()
+ assert reply == expected_reply
@pytest.mark.asyncio
@@ -306,7 +306,7 @@ async def test_read_holding_registers(
await coro
else:
reply = await coro
- assert (reply == expected_reply).all()
+ assert reply == expected_reply
server = Server(slave_id, starting_address, expected_reply)
client = AsyncClient(server, protocol)
@@ -316,7 +316,7 @@ async def test_read_holding_registers(
await coro
else:
reply = await coro
- assert (reply == expected_reply).all()
+ assert reply == expected_reply
@pytest.mark.asyncio
@@ -383,7 +383,7 @@ async def test_read_input_registers(proto, slave_id, starting_address, expected_
await coro
else:
reply = await coro
- assert (reply == expected_reply).all()
+ assert reply == expected_reply
server = Server(slave_id, starting_address, expected_reply)
client = AsyncClient(server, protocol)
@@ -393,4 +393,4 @@ async def test_read_input_registers(proto, slave_id, starting_address, expected_
await coro
else:
reply = await coro
- assert (reply == expected_reply).all()
+ assert reply == expected_reply