예제 #1
0
def test_empty_recipe(tmpdir):
    r = Recipe('recipes/sina', 'recipes/')
    with pytest.raises(EmptyRecipe):
        r.load_from_string("")
    with open(op.join(tmpdir, 'meta.yaml'), "w"):
        pass
    with pytest.raises(EmptyRecipe):
        Recipe.from_file(str(tmpdir), str(tmpdir))
    res = Recipe.from_file(str(tmpdir), str(tmpdir), return_exceptions=True)
    assert isinstance(res, EmptyRecipe)
예제 #2
0
def test_stub():
    r = Recipe('recipes/sina', 'recipes/')
    assert r.path == 'recipes/sina/meta.yaml'
    assert r.relpath == 'sina/meta.yaml'
    assert r.reldir == 'sina'
    assert str(r) == 'sina'