Example #1
0
def test_get_model(mocked_models):
    """
    GIVE mocked models and name
    WHEN get_model is called with the name
    THEN the models attribute with that name is returned.
    """
    name = "Model"

    model = models.get_model(name=name)

    assert model == getattr(mocked_models, name)
Example #2
0
def test_get_not_defined(mocked_models):
    """
    GIVE mocked models without model and name
    WHEN get_model is called with the name
    THEN None is returned.
    """
    name = "Model"
    del mocked_models.Model

    model = models.get_model(name=name)

    assert model is None