fix some tests

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
This commit is contained in:
Brian S. Stephan 2025-03-16 20:39:27 -05:00
parent aa4d5a3585
commit 388eadd4a0
Signed by: bss
GPG Key ID: 3DE06D3180895FCB
3 changed files with 4 additions and 4 deletions

View File

@ -18,7 +18,7 @@ from incorporealcms.markdown import handle_markdown_file_path
class StaticSiteGenerator(object): class StaticSiteGenerator(object):
"""Generate static site output based on the instance's content.""" """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. """Create the object to run various operations to generate the static site.
Args: Args:
@ -32,7 +32,7 @@ class StaticSiteGenerator(object):
output_dir = os.path.abspath(output_dir) output_dir = os.path.abspath(output_dir)
# initialize configuration with the path to the instance # initialize configuration with the path to the instance
init_instance(instance_dir) init_instance(instance_dir, extra_config)
def build(self): def build(self):
"""Build the whole static site.""" """Build the whole static site."""

View File

@ -37,10 +37,10 @@ def test_invalid_graphviz_is_not_rendered():
with tempfile.TemporaryDirectory() as tmpdir: with tempfile.TemporaryDirectory() as tmpdir:
src_dir = os.path.join(HERE, 'instance') src_dir = os.path.join(HERE, 'instance')
ssg = StaticSiteGenerator(src_dir, tmpdir) 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): 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) tmpdir, True)
os.chdir(HERE) os.chdir(HERE)