8 Tests fake device objects for proper functionality. 15 FakeReadDevice class should work as intended to emluate a serial 20 Create a fake read device for each test 26 reading one byte at a time should work as expected 28 self.assertEqual(self.device.read(),
't')
29 self.assertEqual(self.device.read(),
'e')
30 self.assertEqual(self.device.read(),
's')
31 self.assertEqual(self.device.read(),
't')
35 reading multiple bytes at a time should work as expected 37 self.assertEqual(self.device.read(3),
'tes')
38 self.assertEqual(self.device.read(),
't')
42 attempting to read too many bytes should raise an exception 44 self.assertRaises(ValueError, self.device.read, 5)
def test_read_multiple_bytes(self)
def test_read_single_byte(self)
def test_read_too_many(self)