def test_to_primitive(self): """ Check converting PDU to primitive """ pdu = P_DATA_TF() pdu.decode(p_data_tf) primitive = pdu.to_primitive() assert primitive.presentation_data_value_list == [[1, p_data_tf[11:]]] assert isinstance(primitive.presentation_data_value_list, list)
def test_from_primitive(self): """ Check converting PDU to primitive """ orig_pdu = P_DATA_TF() orig_pdu.decode(p_data_tf) primitive = orig_pdu.to_primitive() new_pdu = P_DATA_TF() new_pdu.from_primitive(primitive) pdv = new_pdu.presentation_data_value_items[0] assert new_pdu == orig_pdu