def test_u_packet(self): packet = SimPacket(self.uReq) self.assertTrue(packet.isUsbPacket()) self.assertFalse(packet.isConnectedEvent()) request = packet.usbRequest() self.assertIsNotNone(request) self.assertEquals(0x80, request.bmRequestType) self.assertEquals(0x06, request.bRequest) self.assertTrue(request.isDescriptorRequest())
def test_d_req(self): packet = SimPacket(d_req) self.assertEquals(0x09, packet.getRequestedDescriptorSize()) self.assertTrue(packet.isDescriptorPacket())
def test_d_req(self): packet = SimPacket(d_req) self.assertEquals(d_req_hex, packet.format()) self.assertTrue(packet.isDescriptorPacket())
def test_format_a_u(self): packet = SimPacket(a_u) self.assertEquals(a_u_hex, packet.format())
def test_f_disc_packet(self): packet = SimPacket(self.fDiscReq) self.assertTrue(packet.isDisconnectedEvent()) self.assertFalse(packet.isConnectedEvent())