def test_feed_byte(self): """Put various things into feed_byte().""" import mido.parser parser = mido.parser.Parser() parser.feed_byte(0) parser.feed_byte(255) self.assertRaises(TypeError, parser.feed_byte, [1, 2, 3]) self.assertRaises(ValueError, parser.feed_byte, -1) self.assertRaises(ValueError, parser.feed_byte, 256)
def not_test_parse_random_bytes(self): r = random.Random('a_random_seed') parser = mido.Parser() for _ in range(10000): byte = r.randrange(256) parser.feed_byte(byte)