def test_to_a_p_abort_primitive(self): """ Check converting PDU to a_p_abort primitive """ pdu = A_ABORT_RQ() pdu.Decode(a_p_abort) primitive = pdu.ToParams() self.assertTrue(isinstance(primitive, A_P_ABORT)) self.assertEqual(primitive.provider_reason, 4)
def test_a_p_abort_from_primitive(self): """ Check converting PDU to primitive """ orig_pdu = A_ABORT_RQ() orig_pdu.Decode(a_p_abort) primitive = orig_pdu.ToParams() new_pdu = A_ABORT_RQ() new_pdu.FromParams(primitive) self.assertEqual(new_pdu, orig_pdu)