def test_to_uml(self): doc = self.registry.Documentation() doc.auto_doc() format_ = Configuration.get('schema_format') dot = ModelSchema('test', format=format_) doc.toUML(dot) dot.save()
def test_one_model_with_class_which_associate_label(self): dot = ModelSchema('My UML model') label = dot.add_label('My label') cls = dot.add_class('My class') cls.associate(label) cls.associate(cls, label_from='test') dot.render()
def test_one_model_with_class_which_extend_label(self): dot = ModelSchema('My UML model') label = dot.add_label('My label') cls = dot.add_class('My class') cls.add_method('One method') cls.extend(label) dot.render()
def registry2doc(application, configuration_groups, **kwargs): """Return auto documentation for the registry :param application: name of the application :param configuration_groups: list configuration groupe to load :param \**kwargs: ArgumentParser named arguments """ format_configuration(configuration_groups, 'doc', 'schema') registry = anyblok.start(application, configuration_groups=configuration_groups, **kwargs) if registry: registry.commit() doc = registry.Documentation() doc.auto_doc() if Configuration.get('doc_format') == 'RST': with open(Configuration.get('doc_output'), 'w') as fp: doc.toRST(fp) elif Configuration.get('doc_format') == 'UML': format_ = Configuration.get('schema_format') name_ = Configuration.get('schema_output') dot = ModelSchema(name_, format=format_) doc.toUML(dot) dot.save() elif Configuration.get('doc_format') == 'SQL': format_ = Configuration.get('schema_format') name_ = Configuration.get('schema_output') dot = SQLSchema(name_, format=format_) doc.toSQL(dot) dot.save()
def anyblok2doc(): """Return auto documentation for the registry """ anyblok_registry = anyblok.start('autodoc') if anyblok_registry: anyblok_registry.commit() doc = anyblok_registry.Documentation() doc.auto_doc() if Configuration.get('doc_format') == 'RST': with open(Configuration.get('doc_output'), 'w') as fp: doc.toRST(fp) elif Configuration.get('doc_format') == 'UML': format_ = Configuration.get('schema_format') name_ = Configuration.get('schema_output') dot = ModelSchema(name_, format=format_) doc.toUML(dot) dot.save() elif Configuration.get('doc_format') == 'SQL': format_ = Configuration.get('schema_format') name_ = Configuration.get('schema_output') dot = SQLSchema(name_, format=format_) doc.toSQL(dot) dot.save()
def anyblok2doc(): """Return auto documentation for the registry """ registry = anyblok.start('autodoc') if registry: registry.commit() doc = registry.Documentation() doc.auto_doc() if Configuration.get('doc_format') == 'RST': with open(Configuration.get('doc_output'), 'w') as fp: doc.toRST(fp) elif Configuration.get('doc_format') == 'UML': format_ = Configuration.get('schema_format') name_ = Configuration.get('schema_output') dot = ModelSchema(name_, format=format_) doc.toUML(dot) dot.save() elif Configuration.get('doc_format') == 'SQL': format_ = Configuration.get('schema_format') name_ = Configuration.get('schema_output') dot = SQLSchema(name_, format=format_) doc.toSQL(dot) dot.save()
def test_one_model_with_class(self): dot = ModelSchema('My UML model') dot.add_class('My class') dot.render()
def test_one_model_with_label(self): dot = ModelSchema('My UML model') dot.add_label('My label') dot.render()
def test_get_class(self): dot = ModelSchema('My UML model') cls = dot.add_class('My class') assert dot.get_class('My class') == cls
def test_get_class(self): dot = ModelSchema('My UML model') cls = dot.add_class('My class') self.assertEqual(dot.get_class('My class'), cls)
def test_one_model_with_class_which_strong_agregate_label(self): dot = ModelSchema('My UML model') label = dot.add_label('My label') cls = dot.add_class('My class') cls.strong_agregate(label, multiplicity_from='test') dot.render()