Ejemplo n.º 1
0
 def test_to_sql(self):
     doc = self.registry.Documentation()
     doc.auto_doc()
     format_ = Configuration.get('schema_format')
     dot = SQLSchema('test', format=format_)
     doc.toSQL(dot)
     dot.save()
Ejemplo n.º 2
0
 def test_to_sql(self):
     doc = self.registry.Documentation()
     doc.auto_doc()
     format_ = Configuration.get('schema_format')
     dot = SQLSchema('test', format=format_)
     doc.toSQL(dot)
     dot.save()
Ejemplo n.º 3
0
 def test_one_table_with_foreign_key_on_label(self):
     dot = SQLSchema('My table model')
     table = dot.add_label('My table')
     table.add_column('My column', 'Integer', primary_key=True)
     table2 = dot.add_table('A 2nd table')
     table2.add_foreign_key('My fk', table, nullable=False)
     dot.render()
Ejemplo n.º 4
0
 def test_to_sql(self, rollback_registry):
     registry = rollback_registry
     doc = registry.Documentation()
     doc.auto_doc()
     format_ = Configuration.get('schema_format')
     dot = SQLSchema('test', format=format_)
     doc.toSQL(dot)
     dot.save()
Ejemplo n.º 5
0
 def test_one_table_with_foreign_key_on_label(self):
     dot = SQLSchema('My table model')
     table = dot.add_label('My table')
     table.add_column('My column', 'Integer', primary_key=True)
     table2 = dot.add_table('A 2nd table')
     table2.add_foreign_key('My fk', table, nullable=False)
     dot.render()
Ejemplo n.º 6
0
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()
Ejemplo n.º 7
0
 def test_get_table_with_label(self):
     dot = SQLSchema('My UML model')
     table = dot.add_label('My table')
     self.assertEqual(dot.get_table('My table'), table)
Ejemplo n.º 8
0
 def test_one_table_with_column(self):
     dot = SQLSchema('My table model')
     table = dot.add_table('My table')
     table.add_column('My column', 'Integer', primary_key=True)
     dot.render()
Ejemplo n.º 9
0
 def test_one_label(self):
     dot = SQLSchema('My table model')
     dot.add_table('My table')
     dot.render()
Ejemplo n.º 10
0
 def test_get_table_with_label(self):
     dot = SQLSchema('My UML model')
     table = dot.add_label('My table')
     assert dot.get_table('My table') == table
Ejemplo n.º 11
0
 def test_get_table_with_label(self):
     dot = SQLSchema('My UML model')
     table = dot.add_label('My table')
     self.assertEqual(dot.get_table('My table'), table)
Ejemplo n.º 12
0
 def test_one_table_with_column(self):
     dot = SQLSchema('My table model')
     table = dot.add_table('My table')
     table.add_column('My column', 'Integer', primary_key=True)
     dot.render()
Ejemplo n.º 13
0
 def test_one_label(self):
     dot = SQLSchema('My table model')
     dot.add_table('My table')
     dot.render()