def _fill_non_testsuites_response_property(xml_root, name, value):
    """Returns testcases/requirements response property and fills it if missing."""
    properties = xml_root.find("response-properties")
    if properties is None:
        properties = etree.Element("response-properties")
        # response properties needs to be on top!
        xml_root.insert(0, properties)
    for prop in properties:
        if prop.tag == "response-property":
            prop_name = prop.get("name")
            prop_value = prop.get("value")
            if prop_name and prop_value:
                response_property = (prop_name, utils.get_unicode_str(prop_value))
            break
    else:
        etree.SubElement(properties, "response-property", {"name": name, "value": value})
        response_property = (name, value)

    return response_property
def _fill_non_testsuites_response_property ( xml_root , name , value ) : properties = xml_root . find ( "response-properties" ) if properties is None : properties = etree . Element ( "response-properties" ) xml_root . insert ( 0 , properties ) for prop in properties : if prop . tag == "response-property" : prop_name = prop . get ( "name" ) prop_value = prop . get ( "value" ) if prop_name and prop_value : response_property = ( prop_name , utils . get_unicode_str ( prop_value ) ) break else : etree . SubElement ( properties , "response-property" , { "name" : name , "value" : value } ) response_property = ( name , value ) return response_property
Returns testcases/requirements response property and fills it if missing.