Пример #1
0
    def test_to_primitive(self):
        """ Check converting PDU to primitive """
        pdu = A_RELEASE_RP()
        pdu.Decode(a_release_rp)

        primitive = pdu.ToParams()

        self.assertEqual(primitive.reason, "normal")
        self.assertEqual(primitive.result, "affirmative")
Пример #2
0
    def test_from_primitive(self):
        """ Check converting PDU to primitive """
        orig_pdu = A_RELEASE_RP()
        orig_pdu.Decode(a_release_rp)

        primitive = orig_pdu.ToParams()

        new_pdu = A_RELEASE_RP()
        new_pdu.FromParams(primitive)

        self.assertEqual(new_pdu, orig_pdu)