fix unit test

This commit is contained in:
Tobias Oberstein 2017-04-15 14:41:51 +02:00
parent e554bbfe61
commit 420ceff178

View File

@ -95,16 +95,13 @@ class Test(TestCase):
server.stringReceived = receiver
server.connection_made(transport)
# XXX this test was disabled for a while, and had \xF1 instead
# of \x51 in the second octet previously; changing it
# presuming the 'real' code is correct
hs = b'\x7F\x51\x00\x00' + b'\x00\x00\x00\x04abcd'
hs = b'\x7F\xF1\x00\x00' + b'\x00\x00\x00\x04abcd'
server.data_received(hs)
ser.assert_called_once_with(1)
on_hs.assert_called_once_with()
self.assertTrue(transport.write.called)
transport.write.assert_called_once_with(b'\x7F\x51\x00\x00')
transport.write.assert_called_once_with(b'\x7F\xF1\x00\x00')
self.assertFalse(transport.close.called)
receiver.assert_called_once_with(b'abcd')