Ejemplo n.º 1
0
    def test_from_primitive(self):
        """ Check converting PDU to primitive """
        orig_pdu = P_DATA_TF()
        orig_pdu.Decode(p_data_tf)

        primitive = orig_pdu.ToParams()

        new_pdu = P_DATA_TF()
        new_pdu.FromParams(primitive)

        self.assertEqual(new_pdu, orig_pdu)
Ejemplo n.º 2
0
    def test_to_primitive(self):
        """ Check converting PDU to primitive """
        pdu = P_DATA_TF()
        pdu.Decode(p_data_tf)

        primitive = pdu.ToParams()

        self.assertEqual(primitive.presentation_data_value_list,
                         [[1, p_data_tf[11:]]])
        self.assertTrue(
            isinstance(primitive.presentation_data_value_list, list))