提交 30e57bce 编写于 作者: L Lucas Meneghel Rodrigues

Merge pull request #947 from clebergnu/behave_without_html_plugin

HTML output support: behave when the plugin is not installed
......@@ -30,6 +30,18 @@ from ..utils import path as utils_path
from ..utils import runtime
def check_resource_requirements():
"""
Checks if necessary resource files to render the report are in place
Currently, only the template file is looked for
"""
base_path = os.path.dirname(sys.modules[__name__].__file__)
html_resources_path = os.path.join(base_path, 'resources', 'htmlresult')
template = os.path.join(html_resources_path, 'templates', 'report.mustache')
return os.path.exists(template)
class ReportModel(object):
"""
......
......@@ -53,7 +53,7 @@ from ..utils import data_structures
try:
from . import html
HTML_REPORT_SUPPORT = True
HTML_REPORT_SUPPORT = html.check_resource_requirements()
except ImportError:
HTML_REPORT_SUPPORT = False
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册