Ejemplo n.º 1
0
def test_task__add_models(task_b: Task, model_factory,
                          meta: MetadataRepository):
    models = [model_factory() for _ in range(5)]
    assert len(task_b.models) == 0
    task_b.add_models(models)
    assert len(task_b.models) == 5

    for m in models:
        model_id = m.id
        assert model_id is not None
        assert m == meta.get_model_by_id(model_id)
        assert m == task_b.models[model_id]
        assert m == task_b.models(m.name)
Ejemplo n.º 2
0
def test_task__add_models__empty(task_b: Task):
    task_b.add_models([])
    assert len(task_b.models) == 0