Ejemplo n.º 1
0
def test_simple_models():
    expected_models = [
        'Accounting', 'AdmissionRule', 'AssignedResource', 'Challenge',
        'EventLog', 'EventLogHostname', 'File', 'FragJob',
        'GanttJobsPrediction', 'GanttJobsPredictionsLog',
        'GanttJobsPredictionsVisu', 'GanttJobsResource',
        'GanttJobsResourcesLog', 'GanttJobsResourcesVisu', 'Job',
        'JobDependencie', 'JobResourceDescription', 'JobResourceGroup',
        'JobStateLog', 'JobType', 'MoldableJobDescription', 'Queue',
        'Resource', 'ResourceLog', 'Scheduler'
    ]
    assert set(list(db.models.keys())) == set(expected_models)
    assert set(list(dict(all_models()).keys())) == set(expected_models)

    # len(tables) = len(Models) + table schema
    assert len(dict(all_tables()).keys()) == len(expected_models) + 1
Ejemplo n.º 2
0
 def current_models(self):
     """ Return a namespace with all mapping classes"""
     from oar.lib.models import all_models  # avoid a circular import
     return dict(all_models())