Пример #1
0
 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())
Пример #2
0
 def test_d_req(self):
     packet = SimPacket(d_req)
     self.assertEquals(0x09, packet.getRequestedDescriptorSize())
     self.assertTrue(packet.isDescriptorPacket())
Пример #3
0
 def test_d_req(self):
     packet = SimPacket(d_req)
     self.assertEquals(d_req_hex, packet.format())
     self.assertTrue(packet.isDescriptorPacket())
Пример #4
0
 def test_format_a_u(self):
     packet = SimPacket(a_u)
     self.assertEquals(a_u_hex, packet.format())
Пример #5
0
 def test_f_disc_packet(self):
     packet = SimPacket(self.fDiscReq)
     self.assertTrue(packet.isDisconnectedEvent())
     self.assertFalse(packet.isConnectedEvent())