Ejemplo n.º 1
0
 def _loader(*parsed_items):
     parsed_data = {
         "1": element(
             id="1", type="Diagram", canvas=canvas(canvasitems=list(parsed_items))
         ),
         **{p.id: p for p in parsed_items},
     }
     load_elements(parsed_data, element_factory, modeling_language)
     return element_factory.lselect()[0].canvas.get_root_items()[0]
Ejemplo n.º 2
0
def test_upgrade_subsystem_item_to_class_item(element_factory):
    elements = {
        "1": element(
            id="1",
            type="Diagram",
            canvas=canvas(canvasitems=[canvasitem(id="2", type="SubsystemItem")]),
        )
    }

    load_elements(elements, element_factory)
    item = element_factory.lselect()[0].canvas.get_root_items()[0]
    assert type(item) == diagramitems.ComponentItem