test the high level SSG build command
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
This commit is contained in:
@@ -129,3 +129,26 @@ def test_build_in_destination_ignores_dot_files():
|
||||
generator.build_in_destination(os.path.join(src_dir, 'pages'), tmpdir)
|
||||
|
||||
assert not os.path.exists(os.path.join(tmpdir, '.ignored-file.md'))
|
||||
|
||||
|
||||
def test_build():
|
||||
"""Test that the high level build can work against two directories."""
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
src_dir = os.path.join(HERE, 'instance')
|
||||
generator = ssg.StaticSiteGenerator(src_dir, tmpdir)
|
||||
generator.build()
|
||||
|
||||
assert os.path.exists(os.path.join(tmpdir, 'index.md'))
|
||||
assert os.path.exists(os.path.join(tmpdir, 'index.html'))
|
||||
assert os.path.exists(os.path.join(tmpdir, 'subdir', 'index.md'))
|
||||
assert os.path.exists(os.path.join(tmpdir, 'subdir', 'index.html'))
|
||||
assert os.path.exists(os.path.join(tmpdir, 'symlink-to-subdir'))
|
||||
assert os.path.isdir(os.path.join(tmpdir, 'symlink-to-subdir'))
|
||||
assert os.path.islink(os.path.join(tmpdir, 'symlink-to-subdir'))
|
||||
assert os.path.exists(os.path.join(tmpdir, 'media'))
|
||||
assert os.path.isdir(os.path.join(tmpdir, 'media'))
|
||||
assert not os.path.exists(os.path.join(tmpdir, '.ignored-file.md'))
|
||||
assert os.path.exists(os.path.join(tmpdir, 'feed'))
|
||||
assert os.path.isdir(os.path.join(tmpdir, 'feed'))
|
||||
assert os.path.exists(os.path.join(tmpdir, 'feed/atom'))
|
||||
assert os.path.exists(os.path.join(tmpdir, 'feed/rss'))
|
||||
|
||||
Reference in New Issue
Block a user