Beispiel #1
0
def create_api_models(bus):
    """Create all the API models and return as a dictionary for DSE2."""
    res = {}
    res['api-policy'] = policy_model.PolicyModel('api-policy', bus=bus)
    res['api-rule'] = rule_model.RuleModel('api-rule', bus=bus)
    res['api-row'] = row_model.RowModel('api-row', bus=bus)
    res['api-datasource'] = datasource_model.DatasourceModel('api-datasource',
                                                             bus=bus)
    res['api-schema'] = schema_model.SchemaModel('api-schema', bus=bus)
    res['api-table'] = table_model.TableModel('api-table', bus=bus)
    res['api-status'] = status_model.StatusModel('api-status', bus=bus)
    res['api-action'] = action_model.ActionsModel('api-action', bus=bus)
    res['api-system'] = driver_model.DatasourceDriverModel('api-system',
                                                           bus=bus)
    return res
 def setUp(self):
     super(TestSchemaModel, self).setUp()
     # Here we load the fake driver and test the schema functions with it.
     cfg.CONF.set_override(
         'drivers', ['congress.tests.fake_datasource.FakeDataSource'])
     self.schema_model = schema_model.SchemaModel("test_schema", {})