fix some tests
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
This commit is contained in:
parent
aa4d5a3585
commit
388eadd4a0
@ -18,7 +18,7 @@ from incorporealcms.markdown import handle_markdown_file_path
|
||||
class StaticSiteGenerator(object):
|
||||
"""Generate static site output based on the instance's content."""
|
||||
|
||||
def __init__(self, instance_dir: str, output_dir: str):
|
||||
def __init__(self, instance_dir: str, output_dir: str, extra_config=None):
|
||||
"""Create the object to run various operations to generate the static site.
|
||||
|
||||
Args:
|
||||
@ -32,7 +32,7 @@ class StaticSiteGenerator(object):
|
||||
output_dir = os.path.abspath(output_dir)
|
||||
|
||||
# initialize configuration with the path to the instance
|
||||
init_instance(instance_dir)
|
||||
init_instance(instance_dir, extra_config)
|
||||
|
||||
def build(self):
|
||||
"""Build the whole static site."""
|
||||
|
@ -37,10 +37,10 @@ def test_invalid_graphviz_is_not_rendered():
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
src_dir = os.path.join(HERE, 'instance')
|
||||
ssg = StaticSiteGenerator(src_dir, tmpdir)
|
||||
os.chdir(os.path.join(src_dir, 'pages'))
|
||||
os.chdir(os.path.join(src_dir, 'broken'))
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
ssg.build_file_in_destination(os.path.join(HERE, 'instance', 'pages'), '', 'test-invalid-graphviz.md',
|
||||
ssg.build_file_in_destination(os.path.join(HERE, 'instance', 'broken'), '', 'test-invalid-graphviz.md',
|
||||
tmpdir, True)
|
||||
os.chdir(HERE)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user