

def it_can_construct_from_attribute_values(self):
    cases = (('rId9', 'ReLtYpE', 'foo/bar.xml', None), ('rId9', 'ReLtYpE', 'bar/foo.xml', RTM.INTERNAL), ('rId9', 'ReLtYpE', 'http://some/link', RTM.EXTERNAL))
    for (rId, reltype, target, target_mode) in cases:
        if (target_mode is None):
            rel = CT_Relationship.new(rId, reltype, target)
        else:
            rel = CT_Relationship.new(rId, reltype, target, target_mode)
        builder = a_Relationship().with_target(target)
        if (target_mode == RTM.EXTERNAL):
            builder = builder.with_target_mode(RTM.EXTERNAL)
        expected_rel_xml = builder.xml
        assert (rel.xml == expected_rel_xml)

dataset/ETHPy150Open python-openxml/python-docx/tests/opc/test_oxml.py DescribeCT_Relationship.it_can_construct_from_attribute_values/original