コード例 #1
0
ファイル: test_protocol.py プロジェクト: utopianf/slave
 def test_write_with_response_data(self):
     transport = MockTransport(responses=[b'R10\r'])
     protocol = OxfordIsobus(address=7)
     with pytest.raises(ValueError) as excinfo:
         protocol.write(transport, 'R', '11')
     assert str(excinfo.value) == 'Unexpected response data:10'
コード例 #2
0
ファイル: test_protocol.py プロジェクト: p3trus/slave
 def test_write_with_response_data(self):
     transport = MockTransport(responses=[b'R10\r'])
     protocol = OxfordIsobus(address=7)
     with pytest.raises(ValueError) as excinfo:
         protocol.write(transport, 'R', '11')
     assert str(excinfo.value) == 'Unexpected response data:10'
コード例 #3
0
ファイル: test_protocol.py プロジェクト: utopianf/slave
 def test_write_with_data(self):
     transport = MockTransport(responses=[b'R\r'])
     protocol = OxfordIsobus(address=7)
     protocol.write(transport, 'R', '10')
     assert transport.messages[0] == b'@7R10\r'
コード例 #4
0
ファイル: test_protocol.py プロジェクト: p3trus/slave
 def test_write_with_data(self):
     transport = MockTransport(responses=[b'R\r'])
     protocol = OxfordIsobus(address=7)
     protocol.write(transport, 'R', '10')
     assert transport.messages[0] == b'@7R10\r'