コード例 #1
0
ファイル: test_protocol.py プロジェクト: utopianf/slave
 def test_parse_response_with_wrong_header(self):
     protocol = OxfordIsobus()
     with pytest.raises(ValueError) as excinfo:
         protocol.parse_response(b'U1', 'R')
     assert str(excinfo.value) == 'Response header mismatch'
コード例 #2
0
ファイル: test_protocol.py プロジェクト: utopianf/slave
 def test_parse_response_with_error(self):
     protocol = OxfordIsobus()
     with pytest.raises(IOError) as excinfo:
         protocol.parse_response(b'?R', 'R')
     assert str(excinfo.value) == '?R'
コード例 #3
0
ファイル: test_protocol.py プロジェクト: utopianf/slave
 def test_parse_response_with_data(self):
     protocol = OxfordIsobus()
     assert protocol.parse_response(b'R1337', 'R') == '1337'
コード例 #4
0
ファイル: test_protocol.py プロジェクト: p3trus/slave
 def test_parse_response_with_wrong_header(self):
     protocol = OxfordIsobus()
     with pytest.raises(ValueError) as excinfo:
         protocol.parse_response(b'U1', 'R')
     assert str(excinfo.value) == 'Response header mismatch'
コード例 #5
0
ファイル: test_protocol.py プロジェクト: p3trus/slave
 def test_parse_response_with_error(self):
     protocol = OxfordIsobus()
     with pytest.raises(IOError) as excinfo:
         protocol.parse_response(b'?R', 'R')
     assert str(excinfo.value) == '?R'
コード例 #6
0
ファイル: test_protocol.py プロジェクト: p3trus/slave
 def test_parse_response_with_data(self):
     protocol = OxfordIsobus()
     assert protocol.parse_response(b'R1337', 'R') == '1337'