Skip to content
Snippets Groups Projects
Commit 866b866e authored by Nathan Hertz's avatar Nathan Hertz
Browse files

More work on tests for setup_to_meta.

parent 0fd2cdca
No related branches found
No related tags found
No related merge requests found
import pytest
import zc.buildout.testing
@pytest.fixture(scope='module')
def set_up():
from ..setup_to_meta import Recipe
recipe = Recipe(buildout=None, name=None, options={'recipe': 'setup_to_meta'})
from .. import setup_to_meta
buildout = zc.buildout.testing.Buildout()
options = buildout.Options(buildout, 'gen_metadata', {'recipe': 'setup_to_meta'})
recipe = setup_to_meta.Recipe(buildout=buildout, name=None, options=options)
return recipe
\ No newline at end of file
......@@ -2,5 +2,16 @@ import pytest
class TestSetupToMeta:
def test_output(self, set_up):
recipe = set_up
recipe.install()
"""
Test that metadata was successfully created and contains data.
Checking for 'package' is an arbitrary check for content that will always
occur in a correct recipe.
:param set_up: Fixture that initializes
:return:
"""
created = set_up.install()
for path in created:
with open(path, 'r') as f:
assert 'package' in f.read()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment