Exemple #1
0
def test_parse_operation(factory):
    """Test parsing simple operation."""
    o = factory.create(UML.Operation)
    UML.parse(o, "myfunc()")
    assert "myfunc" == o.name
    assert not o.returnResult[0].typeValue
    assert not o.formalParameter
Exemple #2
0
    def test_association_notification(self):
        """
        Test notifications with Class object.
        
        Tricky case where no events are fired.
        """
        dispatcher = self.dispatcher
        element = UML.Association()
        p1 = element.memberEnd = UML.Property()
        p2 = element.memberEnd = UML.Property()

        assert len(element.memberEnd) == 2
        print(element.memberEnd)
        dispatcher.register_handler(self._handler, element, 'memberEnd.name')
        assert len(dispatcher._handlers) == 3, len(dispatcher._handlers)
        assert not self.events

        p1.name = 'foo'
        assert len(self.events) == 1, (self.events, dispatcher._handlers)
        assert len(dispatcher._handlers) == 3

        p1.name = 'othername'
        assert len(self.events) == 2, self.events

        p1.name = 'othername'
        assert len(self.events) == 2, self.events
Exemple #3
0
    def test_register_handler_twice(self):
        """
        Multiple registrations have no effect.
        """
        dispatcher = self.dispatcher
        element = UML.Class()

        # Add some properties:

        element.ownedOperation = UML.Operation()
        p = element.ownedOperation[0].formalParameter = UML.Parameter()
        dispatcher.register_handler(self._handler, element,
                                    'ownedOperation.parameter.name')

        n_handlers = len(dispatcher._handlers)

        self.assertEquals(0, len(self.events))
        dispatcher.register_handler(self._handler, element,
                                    'ownedOperation.parameter.name')
        self.assertEquals(n_handlers, len(dispatcher._handlers))
        dispatcher.register_handler(self._handler, element,
                                    'ownedOperation.parameter.name')
        self.assertEquals(n_handlers, len(dispatcher._handlers))
        dispatcher.register_handler(self._handler, element,
                                    'ownedOperation.parameter.name')
        self.assertEquals(n_handlers, len(dispatcher._handlers))

        p.name = 'func'
        self.assertEquals(1, len(self.events))
Exemple #4
0
 def test_parse_operation(self):
     """Test parsing simple operation
     """
     o = factory.create(UML.Operation)
     UML.parse(o, "myfunc()")
     self.assertEqual("myfunc", o.name)
     self.assertTrue(not o.returnResult[0].typeValue)
     self.assertFalse(o.formalParameter)
Exemple #5
0
 def test_parse_operation(self):
     """Test parsing simple operation
     """
     o = factory.create(UML.Operation)
     UML.parse(o, 'myfunc()')
     self.assertEquals('myfunc', o.name)
     self.assertTrue(not o.returnResult[0].typeValue)
     self.assertFalse(o.formalParameter)
Exemple #6
0
def test_parse_operation_return(factory):
    """Test parsing operation with return value."""
    o = factory.create(UML.Operation)
    UML.parse(o, "+ myfunc(): int")
    assert "myfunc" == o.name
    assert "int" == o.returnResult[0].typeValue
    assert "public" == o.visibility
    assert not o.formalParameter
Exemple #7
0
 def test_parse_operation_return(self):
     """Test parsing operation with return value
     """
     o = factory.create(UML.Operation)
     UML.parse(o, "+ myfunc(): int")
     self.assertEqual("myfunc", o.name)
     self.assertEqual("int", o.returnResult[0].typeValue)
     self.assertEqual("public", o.visibility)
     self.assertTrue(not o.formalParameter)
Exemple #8
0
 def test_parse_operation_return(self):
     """Test parsing operation with return value
     """
     o = factory.create(UML.Operation)
     UML.parse(o, '+ myfunc(): int')
     self.assertEquals('myfunc', o.name)
     self.assertEquals('int', o.returnResult[0].typeValue)
     self.assertEquals('public', o.visibility)
     self.assertTrue(not o.formalParameter)
Exemple #9
0
def test_parse_property_simple(factory):
    """Test simple property parsing."""
    a = factory.create(UML.Property)
    UML.parse(a, "myattr")
    assert not a.isDerived
    assert "myattr" == a.name
    assert a.typeValue is None, a.typeValue
    assert a.lowerValue is None, a.lowerValue
    assert a.upperValue is None, a.upperValue
    assert a.defaultValue is None, a.defaultValue
Exemple #10
0
 def test_parse_property_simple(self):
     """Test simple property parsing
     """
     a = factory.create(UML.Property)
     UML.parse(a, 'myattr')
     self.assertFalse(a.isDerived)
     self.assertEquals('myattr', a.name)
     self.assertTrue(a.typeValue is None, a.typeValue)
     self.assertTrue(a.lowerValue is None, a.lowerValue)
     self.assertTrue(a.upperValue is None, a.upperValue)
     self.assertTrue(a.defaultValue is None, a.defaultValue)
Exemple #11
0
def test_parse_operation_1_param(factory):
    """Test parsing of operation with one parameter."""
    o = factory.create(UML.Operation)
    UML.parse(o, "- myfunc2 (a: node): double")
    assert "myfunc2" == o.name
    assert "double" == o.returnResult[0].typeValue
    assert "private" == o.visibility
    assert len(o.formalParameter) == 1
    assert "a" == o.formalParameter[0].name
    assert "node" == o.formalParameter[0].typeValue
    assert o.formalParameter[0].defaultValue is None
Exemple #12
0
 def test_parse_property_simple(self):
     """Test simple property parsing
     """
     a = factory.create(UML.Property)
     UML.parse(a, "myattr")
     self.assertFalse(a.isDerived)
     self.assertEqual("myattr", a.name)
     self.assertTrue(a.typeValue is None, a.typeValue)
     self.assertTrue(a.lowerValue is None, a.lowerValue)
     self.assertTrue(a.upperValue is None, a.upperValue)
     self.assertTrue(a.defaultValue is None, a.defaultValue)
Exemple #13
0
def test_parse_association_end_multiplicity(factory):
    """Test parsing of multiplicity."""
    a = factory.create(UML.Association)
    p = factory.create(UML.Property)
    p.association = a
    UML.parse(p, "0..2 { tag }")
    assert p.name is None
    assert not p.typeValue
    assert "0" == p.lowerValue
    assert "2" == p.upperValue
    assert not p.defaultValue
Exemple #14
0
def test_parse_property_invalid(factory):
    """Test parsing property with invalid syntax."""
    a = factory.create(UML.Property)

    UML.parse(a, '+ name = str[*] = "aap" { static }')
    assert '+ name = str[*] = "aap" { static }' == a.name
    assert not a.isDerived
    assert not a.typeValue
    assert not a.lowerValue
    assert not a.upperValue
    assert not a.defaultValue
Exemple #15
0
 def _set_object_value(self, row, col, value):
     attr = row[-1]
     if col == 0:
         UML.parse(attr, value)
         row[0] = UML.format(attr)
     elif col == 1:
         attr.isStatic = not attr.isStatic
         row[1] = attr.isStatic
     elif col == 2:
         # Value in attribute object changed:
         row[0] = UML.format(attr)
         row[1] = attr.isStatic
Exemple #16
0
 def test_parse_multiplicity(self):
     """Test parsing of multiplicity
     """
     a = factory.create(UML.Association)
     p = factory.create(UML.Property)
     p.association = a
     UML.parse(p, "0..2 { tag }")
     self.assertTrue(p.name is None)
     self.assertTrue(not p.typeValue)
     self.assertEqual("0", p.lowerValue)
     self.assertEqual("2", p.upperValue)
     self.assertTrue(not p.defaultValue)
Exemple #17
0
 def test_parse_operation_1_param(self):
     """Test parsing of operation with one parameter
     """
     o = factory.create(UML.Operation)
     UML.parse(o, "- myfunc2 (a: node): double")
     self.assertEqual("myfunc2", o.name)
     self.assertEqual("double", o.returnResult[0].typeValue)
     self.assertEqual("private", o.visibility)
     self.assertEqual(1, len(o.formalParameter))
     self.assertEqual("a", o.formalParameter[0].name)
     self.assertEqual("node", o.formalParameter[0].typeValue)
     self.assertTrue(o.formalParameter[0].defaultValue is None)
Exemple #18
0
 def _set_object_value(self, row, col, value):
     attr = row[-1]
     if col == 0:
         UML.parse(attr, value)
         row[0] = UML.format(attr)
     elif col == 1:
         attr.isStatic = not attr.isStatic
         row[1] = attr.isStatic
     elif col == 2:
         # Value in attribute object changed:
         row[0] = UML.format(attr)
         row[1] = attr.isStatic
Exemple #19
0
def test_parse_property_complex(factory):
    """Test complex property parsing."""
    a = factory.create(UML.Property)

    UML.parse(a, '+ / name : str[0..*] = "aap" { static }')
    assert "public" == a.visibility
    assert a.isDerived
    assert "name" == a.name
    assert "str" == a.typeValue
    assert "0" == a.lowerValue
    assert "*" == a.upperValue
    assert '"aap"' == a.defaultValue
Exemple #20
0
def test_parse_association_end(factory):
    """Test parsing of association end."""
    a = factory.create(UML.Association)
    p = factory.create(UML.Property)
    p.association = a

    UML.parse(p, "end")
    assert "end" == p.name
    assert not p.typeValue
    assert not p.lowerValue
    assert not p.upperValue
    assert not p.defaultValue
Exemple #21
0
def test_operation_parameter_deletion(factory):
    assert 0 == len(factory.lselect())

    c = factory.create(UML.Class)
    c.name = "Class"
    o = factory.create(UML.Operation)
    c.ownedOperation = o
    UML.parse(o, "a(x: int, y: int)")

    c.unlink()

    assert 0 == len(factory.lselect()), factory.lselect()
Exemple #22
0
    def test_parse_property_invalid(self):
        """Test parsing property with invalid syntax
        """
        a = factory.create(UML.Property)

        UML.parse(a, '+ name = str[*] = "aap" { static }')
        self.assertEqual('+ name = str[*] = "aap" { static }', a.name)
        self.assertFalse(a.isDerived)
        self.assertTrue(not a.typeValue)
        self.assertTrue(not a.lowerValue)
        self.assertTrue(not a.upperValue)
        self.assertTrue(not a.defaultValue)
Exemple #23
0
    def test_parse_property_invalid(self):
        """Test parsing property with invalid syntax
        """
        a = factory.create(UML.Property)

        UML.parse(a, '+ name = str[*] = "aap" { static }')
        self.assertEquals('+ name = str[*] = "aap" { static }', a.name)
        self.assertFalse(a.isDerived)
        self.assertTrue(not a.typeValue)
        self.assertTrue(not a.lowerValue)
        self.assertTrue(not a.upperValue)
        self.assertTrue(not a.defaultValue)
Exemple #24
0
 def test_parse_multiplicity2(self):
     """Test parsing of multiplicity with multiline constraints
     """
     a = factory.create(UML.Association)
     p = factory.create(UML.Property)
     p.association = a
     UML.parse(p, "0..2 { tag1, \ntag2}")
     self.assertTrue(p.name is None)
     self.assertTrue(not p.typeValue)
     self.assertEqual("0", p.lowerValue)
     self.assertEqual("2", p.upperValue)
     self.assertTrue(not p.defaultValue)
Exemple #25
0
 def test_parse_operation_1_param(self):
     """Test parsing of operation with one parameter
     """
     o = factory.create(UML.Operation)
     UML.parse(o, '- myfunc2 (a: node): double')
     self.assertEquals('myfunc2', o.name)
     self.assertEquals('double', o.returnResult[0].typeValue)
     self.assertEquals('private', o.visibility)
     self.assertEquals(1, len(o.formalParameter))
     self.assertEquals('a', o.formalParameter[0].name)
     self.assertEquals('node', o.formalParameter[0].typeValue)
     self.assertTrue(o.formalParameter[0].defaultValue is None)
Exemple #26
0
 def test_parse_multiplicity2(self):
     """Test parsing of multiplicity with multiline constraints
     """
     a = factory.create(UML.Association)
     p = factory.create(UML.Property)
     p.association = a
     UML.parse(p, '0..2 { tag1, \ntag2}')
     self.assertTrue(p.name is None)
     self.assertTrue(not p.typeValue)
     self.assertEquals('0', p.lowerValue)
     self.assertEquals('2', p.upperValue)
     self.assertTrue(not p.defaultValue)
Exemple #27
0
def test_qualified_name():
    p1 = UML.Package()
    p2 = UML.Package()
    p3 = UML.Package()

    p1.name = "package1"
    p2.name = "package2"
    p3.name = "package3"
    p3.package = p2
    p2.package = p1

    assert p3.qualifiedName == ["package1", "package2", "package3"]
Exemple #28
0
 def test_parse_multiplicity(self):
     """Test parsing of multiplicity
     """
     a = factory.create(UML.Association)
     p = factory.create(UML.Property)
     p.association = a
     UML.parse(p, "0..2 { tag }")
     self.assertTrue(p.name is None)
     self.assertTrue(not p.typeValue)
     self.assertEquals("0", p.lowerValue.value)
     self.assertEquals("2", p.upperValue.value)
     self.assertTrue(not p.defaultValue)
Exemple #29
0
    def test_parse_association_end(self):
        """Test parsing of association end
        """
        a = factory.create(UML.Association)
        p = factory.create(UML.Property)
        p.association = a

        UML.parse(p, "end")
        self.assertEqual("end", p.name)
        self.assertTrue(not p.typeValue)
        self.assertTrue(not p.lowerValue)
        self.assertTrue(not p.upperValue)
        self.assertTrue(not p.defaultValue)
Exemple #30
0
    def test_operation_parameter_deletion(self):
        factory = UML.ElementFactory()
        self.assertEquals(0, len(factory.lselect()))

        c = factory.create(UML.Class)
        c.name = 'Class'
        o = factory.create(UML.Operation)
        c.ownedOperation = o
        UML.parse(o, 'a(x: int, y: int)')

        c.unlink()

        self.assertEquals(0, len(factory.lselect()), factory.lselect())
Exemple #31
0
    def test_operation_parameter_deletion(self):
        factory = UML.ElementFactory()
        self.assertEquals(0, len(factory.lselect()))

        c = factory.create(UML.Class)
        c.name = 'Class'
        o = factory.create(UML.Operation)
        c.ownedOperation = o
        UML.parse(o, 'a(x: int, y: int)')

        c.unlink()

        self.assertEquals(0, len(factory.lselect()), factory.lselect())
Exemple #32
0
    def test_parse_association_end(self):
        """Test parsing of association end
        """
        a = factory.create(UML.Association)
        p = factory.create(UML.Property)
        p.association = a

        UML.parse(p, 'end')
        self.assertEquals('end', p.name)
        self.assertTrue(not p.typeValue)
        self.assertTrue(not p.lowerValue)
        self.assertTrue(not p.upperValue)
        self.assertTrue(not p.defaultValue)
Exemple #33
0
def test_parse_association_end_derived_end(factory):
    """Test parsing derived association end."""
    a = factory.create(UML.Association)
    p = factory.create(UML.Property)
    p.association = a
    UML.parse(p, "-/end[*] { mytag}")
    assert "private" == p.visibility
    assert p.isDerived
    assert "end" == p.name
    assert not p.typeValue
    assert not p.lowerValue
    assert "*" == p.upperValue
    assert not p.defaultValue
Exemple #34
0
def test_class_with_attributes(diagram, element_factory):
    cls = element_factory.create(UML.Class)
    attr = element_factory.create(UML.Property)
    UML.parse(attr, "- attr: str")
    cls.ownedAttribute = attr

    cls_item = diagram.create(ClassItem, subject=cls)

    new_items = copy_clear_and_paste({cls_item}, diagram, element_factory)
    new_cls_item = new_items.pop()

    assert isinstance(new_cls_item, ClassItem)
    assert UML.format(new_cls_item.subject.ownedAttribute[0]) == "- attr: str"
Exemple #35
0
    def test_parse_property_complex(self):
        """Test complex property parsing
        """
        a = factory.create(UML.Property)

        UML.parse(a, '+ / name : str[0..*] = "aap" { static }')
        self.assertEqual("public", a.visibility)
        self.assertTrue(a.isDerived)
        self.assertEqual("name", a.name)
        self.assertEqual("str", a.typeValue)
        self.assertEqual("0", a.lowerValue)
        self.assertEqual("*", a.upperValue)
        self.assertEqual('"aap"', a.defaultValue)
Exemple #36
0
    def test_parse_property_complex(self):
        """Test complex property parsing
        """
        a = factory.create(UML.Property)

        UML.parse(a, '+ / name : str[0..*] = "aap" { static }')
        self.assertEquals('public', a.visibility)
        self.assertTrue(a.isDerived)
        self.assertEquals('name', a.name)
        self.assertEquals('str', a.typeValue)
        self.assertEquals('0', a.lowerValue)
        self.assertEquals('*', a.upperValue)
        self.assertEquals('"aap"', a.defaultValue)
Exemple #37
0
def test_parse_operation_2_params(factory):
    """Test parsing of operation with two parameters."""
    o = factory.create(UML.Operation)
    UML.parse(o, "# myfunc2 (a: str, b: int = 3 {  static}): float")
    assert "myfunc2" == o.name
    assert "float" == o.returnResult[0].typeValue
    assert "protected" == o.visibility
    assert len(o.formalParameter) == 2
    assert "a" == o.formalParameter[0].name
    assert "str" == o.formalParameter[0].typeValue
    assert o.formalParameter[0].defaultValue is None
    assert "b" == o.formalParameter[1].name
    assert "int" == o.formalParameter[1].typeValue
    assert "3" == o.formalParameter[1].defaultValue
Exemple #38
0
 def test_parse_derived_end(self):
     """Test parsing derived association end
     """
     a = factory.create(UML.Association)
     p = factory.create(UML.Property)
     p.association = a
     UML.parse(p, "-/end[*] { mytag}")
     self.assertEqual("private", p.visibility)
     self.assertTrue(p.isDerived)
     self.assertEqual("end", p.name)
     self.assertTrue(not p.typeValue)
     self.assertTrue(not p.lowerValue)
     self.assertEqual("*", p.upperValue)
     self.assertTrue(not p.defaultValue)
Exemple #39
0
 def test_parse_derived_end(self):
     """Test parsing derived association end
     """
     a = factory.create(UML.Association)
     p = factory.create(UML.Property)
     p.association = a
     UML.parse(p, '-/end[*] { mytag}')
     self.assertEquals('private', p.visibility)
     self.assertTrue(p.isDerived)
     self.assertEquals('end', p.name)
     self.assertTrue(not p.typeValue)
     self.assertTrue(not p.lowerValue)
     self.assertEquals('*', p.upperValue)
     self.assertTrue(not p.defaultValue)
Exemple #40
0
def test_class_with_operation(diagram, element_factory):
    cls = element_factory.create(UML.Class)
    oper = element_factory.create(UML.Operation)
    UML.parse(oper, "- oper(inout param: str): str")
    cls.ownedOperation = oper

    cls_item = diagram.create(ClassItem, subject=cls)

    new_items = copy_clear_and_paste({cls_item}, diagram, element_factory)
    new_cls_item = new_items.pop()

    assert isinstance(new_cls_item, ClassItem)
    assert (UML.format(new_cls_item.subject.ownedOperation[0]) ==
            "- oper(inout param: str): str")
Exemple #41
0
 def test_parse_operation_2_params(self):
     """Test parsing of operation with two parameters
     """
     o = factory.create(UML.Operation)
     UML.parse(o, '# myfunc2 (a: str, b: int = 3 {  static}): float')
     self.assertEquals('myfunc2', o.name)
     self.assertEquals('float', o.returnResult[0].typeValue)
     self.assertEquals('protected', o.visibility)
     self.assertEquals(2, len(o.formalParameter))
     self.assertEquals('a', o.formalParameter[0].name)
     self.assertEquals('str', o.formalParameter[0].typeValue)
     self.assertTrue(o.formalParameter[0].defaultValue is None)
     self.assertEquals('b', o.formalParameter[1].name)
     self.assertEquals('int', o.formalParameter[1].typeValue)
     self.assertEquals('3', o.formalParameter[1].defaultValue)
Exemple #42
0
 def _set_object_value(self, row, col, value):
     operation = row[-1]
     if col == 0:
         UML.parse(operation, value)
         row[0] = UML.format(operation)
     elif col == 1:
         operation.isAbstract = not operation.isAbstract
         row[1] = operation.isAbstract
     elif col == 2:
         operation.isStatic = not operation.isStatic
         row[2] = operation.isStatic
     elif col == 3:
         row[0] = UML.format(operation)
         row[1] = operation.isAbstract
         row[2] = operation.isStatic
Exemple #43
0
 def test_parse_operation_2_params(self):
     """Test parsing of operation with two parameters
     """
     o = factory.create(UML.Operation)
     UML.parse(o, '# myfunc2 (a: str, b: int = 3 {  static}): float')
     self.assertEquals('myfunc2', o.name)
     self.assertEquals('float', o.returnResult[0].typeValue)
     self.assertEquals('protected', o.visibility)
     self.assertEquals(2, len(o.formalParameter))
     self.assertEquals('a', o.formalParameter[0].name)
     self.assertEquals('str', o.formalParameter[0].typeValue)
     self.assertTrue(o.formalParameter[0].defaultValue is None)
     self.assertEquals('b', o.formalParameter[1].name)
     self.assertEquals('int', o.formalParameter[1].typeValue)
     self.assertEquals('3', o.formalParameter[1].defaultValue)
Exemple #44
0
 def _set_object_value(self, row, col, value):
     operation = row[-1]
     if col == 0:
         UML.parse(operation, value)
         row[0] = UML.format(operation)
     elif col == 1:
         operation.isAbstract = not operation.isAbstract
         row[1] = operation.isAbstract
     elif col == 2:
         operation.isStatic = not operation.isStatic
         row[2] = operation.isStatic
     elif col == 3:
         row[0] = UML.format(operation)
         row[1] = operation.isAbstract
         row[2] = operation.isStatic
Exemple #45
0
 def test_parse_operation_2_params(self):
     """Test parsing of operation with two parameters
     """
     o = factory.create(UML.Operation)
     UML.parse(o, "# myfunc2 (a: str, b: int = 3 {  static}): float")
     self.assertEqual("myfunc2", o.name)
     self.assertEqual("float", o.returnResult[0].typeValue)
     self.assertEqual("protected", o.visibility)
     self.assertEqual(2, len(o.formalParameter))
     self.assertEqual("a", o.formalParameter[0].name)
     self.assertEqual("str", o.formalParameter[0].typeValue)
     self.assertTrue(o.formalParameter[0].defaultValue is None)
     self.assertEqual("b", o.formalParameter[1].name)
     self.assertEqual("int", o.formalParameter[1].typeValue)
     self.assertEqual("3", o.formalParameter[1].defaultValue)
Exemple #46
0
 def handler(event):
     if not entry.props.has_focus:
         entry.handler_block(changed_id)
         entry.set_text(UML.format(self.subject,
                                   visibility=True, is_derived=True,
                                   multiplicity=True) or '')
         #entry.set_text(UML.format(self.subject, multiplicity=True) or '')
         entry.handler_unblock(changed_id)
Exemple #47
0
 def render(self):
     """Render the OperationItem."""
     
     return UML.format(self.subject,\
                       visibility=True,\
                       type=True,\
                       multiplicity=True,\
                       default=True) or ''
Exemple #48
0
 def get_text(self):
     if self._edit is self._item:
         return self._edit.subject.name
     return UML.format(
         self._edit.subject,
         visibility=True,
         is_derived=True,
         type=True,
         multiplicity=True,
         default=True,
     )
Exemple #49
0
    def testAttribute(self):
        """
        Test how attribute is updated
        """
        attr = self.element_factory.create(UML.Property)
        UML.parse(attr, '-name:myType')

        clazzitem = self.create(ClassItem, UML.Class)
        clazzitem.subject.ownedAttribute = attr
        self.assertEquals(1, len(clazzitem._compartments[0]))

        item = clazzitem._compartments[0][0]
        self.assertTrue(isinstance(item, FeatureItem))

        size = item.get_size()
        self.assertNotEquals((0, 0), size)

        attr.defaultValue = 'myDefault'

        self.diagram.canvas.update()
        self.assertTrue(size < item.get_size())
Exemple #50
0
 def set_text(self):
     """
     Set the text on the association end.
     """
     if self.subject:
         try:
             n, m = UML.format(self.subject)
         except ValueError:
             # need more than 0 values to unpack: property was rendered as
             # attribute while in a UNDO action for example.
             pass
         else:
             self._name = n
             self._mult = m
             self.request_update()
Exemple #51
0
 def get_text(self):
     return UML.format(editable(self._edit.subject))
Exemple #52
0
 def _on_end_name_change(self, entry):
     UML.parse(self.subject, entry.get_text())
Exemple #53
0
 def _get_rows(self):
     for attr in self._item.subject.ownedAttribute:
         if not attr.association:
             yield [UML.format(attr), attr.isStatic, attr]
Exemple #54
0
 def _get_rows(self):
     for operation in self._item.subject.ownedOperation:
         yield [UML.format(operation), operation.isAbstract, operation.isStatic, operation]
Exemple #55
0
 def test_parse_operation_invalid_syntax(self):
     """Test operation parsing with invalid syntax
     """
     o = factory.create(UML.Operation)
     UML.parse(o, "- myfunc2: myType2")
     self.assertEqual("- myfunc2: myType2", o.name)
Exemple #56
0
 def render(self):
     """
     Return a rendered feature, as a string.
     """
     return UML.format(self.subject, pattern=self.pattern) or ''
Exemple #57
0
 def update_text(self, text):
     UML.parse(editable(self._edit.subject), text)
Exemple #58
0
 def update_text(self, text):
     UML.parse(self._edit.subject, text)