コード例 #1
0
 def test_conversion(self):
     """ Check conversion to a PDU produces the correct output """
     primitive = A_P_ABORT()
     primitive.provider_reason = 4
     
     pdu = A_ABORT_PDU()
     pdu.FromParams(primitive)
     data = pdu.encode()
     
     self.assertEqual(data, b"\x07\x00\x00\x00\x00\x04\x00\x00\x02\x04")
コード例 #2
0
 def test_conversion(self):
     """ Check conversion to a PDU produces the correct output """
     primitive = A_ABORT()
     primitive.abort_source = 0
     
     pdu = A_ABORT_PDU()
     pdu.FromParams(primitive)
     data = pdu.encode()
     
     self.assertEqual(data, b"\x07\x00\x00\x00\x00\x04\x00\x00\x00\x00")