Esempio n. 1
0
def test_get_templates(tmpdir):
    """ test get_templates outside of a package
    """
    os.chdir(tmpdir.strpath)
    reg = TemplateRegistry()
    templates = reg.get_templates()
    assert 'addon' in templates
    assert 'theme_package' in templates
    assert 'buildout' in templates
Esempio n. 2
0
def test_get_subtemplates(tmpdir):
    """ test get_templates inside of a package
    """
    template = """[check-manifest]
check=True

[tool:bobtemplates.plone]
template=plone_addon
"""
    target_dir = tmpdir.strpath + '/collective.foo'
    os.mkdir(target_dir)
    with open(os.path.join(target_dir + '/setup.cfg'), 'w') as f:
        f.write(template)
    os.chdir(target_dir)
    reg = TemplateRegistry()
    templates = reg.get_templates()
    assert 'content_type' in templates
    assert 'theme' in templates
    assert 'vocabulary' in templates