def test_type_converter_with_type(element_factory): """Test type convert for boolean.""" prop = element_factory.create(UML.Property) cls = element_factory.create(UML.Class) prop.type = cls prop.type.name = "boolean" assert type_converter(prop) == "boolean"
def test_type_converter_none(element_factory): """Test type convert with no type.""" prop = element_factory.create(UML.Property) with pytest.raises(ValueError): assert type_converter(prop)
def test_type_converter_other(element_factory): """Test type convert for other type.""" prop = element_factory.create(UML.Property) prop.typeValue = "other_type" assert type_converter(prop) == "other_type"
def test_type_converter_str(element_factory): """Test type convert for a string.""" prop = element_factory.create(UML.Property) prop.typeValue = "string" assert type_converter(prop) == "str"
def test_type_converter_int(element_factory): """Test type convert for an integer.""" prop = element_factory.create(UML.Property) prop.typeValue = "integer" assert type_converter(prop) == "int"
def test_type_converter_boolean(element_factory): """Test type convert for boolean.""" prop = element_factory.create(UML.Property) prop.typeValue = "boolean" assert type_converter(prop) == "int"