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

Finished setup_to_meta tests.

parent 542803e6
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@ import pytest
import zc.buildout.testing
@pytest.fixture(scope='module')
def set_up():
def recipe():
from .. import setup_to_meta
buildout = zc.buildout.testing.Buildout()
options = buildout.Options(buildout, 'gen_metadata', {'recipe': 'setup_to_meta'})
......
import pytest
from .. import setup_to_meta
class TestSetupToMeta:
def test_output(self, set_up):
def test_del_substrings(self):
replaced = setup_to_meta.del_substrings('heallob, woarlcd', ['a', 'b', 'c'])
assert replaced == 'hello, world'
def test_get_names(self):
d = 'apps/cli/executables/null'
assert setup_to_meta.get_names([d]) == ['null']
def test_get_dirs(self):
assert './apps/cli/executables/null' in setup_to_meta.get_dirs()
def test_get_outputs(self):
assert setup_to_meta.get_outputs(['null']) == ['build/metadata/null/meta.yaml']
def test_output(self, recipe):
"""
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:
:param recipe: Fixture that initializes recipe class in setup_to_meta.py
"""
created = set_up.install()
created = recipe.install()
for path in created:
with open(path, 'r') as f:
assert 'package' in f.read()
\ No newline at end of file
assert 'package' in f.read()
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