Skip to content

Commit

Permalink
Step.
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen committed Oct 18, 2024
1 parent eb8817a commit 796e63c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/pdu/test_decoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def test_decode_bad_frame(self, decoder, frame):

def test_decode_unknown_sub(self):
"""Test for unknown sub code."""
assert self.client.decode(b"\x08\x00\x00\x00\x00")
assert self.client.decode(b"\x08\x00\xF0\xF0\x00")

@pytest.mark.parametrize(("decoder"), [server, client])
def test_register_custom_request(self, decoder):
Expand Down Expand Up @@ -155,6 +155,8 @@ def decode(self, _data):
assert decoder.lookupPduClass(CustomRequestResponse.function_code)
CustomRequestResponse.sub_function_code = 0xF7
decoder.register(CustomRequestResponse)
CustomRequestResponse.sub_function_code = 0xF4
decoder.register(CustomRequestResponse)
assert self.server.lookupPduClass(CustomRequestResponse.function_code)
with pytest.raises(MessageRegisterException):
decoder.register(NoCustomRequestResponse)

0 comments on commit 796e63c

Please sign in to comment.