diff options
| author | 2021-02-03 19:17:00 -0500 | |
|---|---|---|
| committer | 2021-02-03 19:17:00 -0500 | |
| commit | 3a0d66f07b112b6d2bdc2b57bbf717a89a351ce6 (patch) | |
| tree | a7cf56282e54f05785243bc1e903d6594f2c06ba /tests/integration/test_archive_per_month.py | |
| parent | 787b97a4cb24330b36f11297c6d3a7a473a907d0 (diff) | |
New upstream version 8.1.2.upstream/8.1.2
Diffstat (limited to 'tests/integration/test_archive_per_month.py')
| -rw-r--r-- | tests/integration/test_archive_per_month.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/integration/test_archive_per_month.py b/tests/integration/test_archive_per_month.py new file mode 100644 index 0000000..5f6c94b --- /dev/null +++ b/tests/integration/test_archive_per_month.py @@ -0,0 +1,36 @@ +"""Check that the monthly archives build and are correct.""" + +import os + +import pytest + +from nikola import __main__ + +from .helper import cd, patch_config +from .test_demo_build import prepare_demo_site +from .test_empty_build import ( # NOQA + test_archive_exists, + test_avoid_double_slash_in_rss, + test_check_files, + test_check_links, + test_index_in_sitemap, +) + + +def test_monthly_archive(build, output_dir): + """Check that the monthly archive is build.""" + assert os.path.isfile(os.path.join(output_dir, "2012", "03", "index.html")) + + +@pytest.fixture(scope="module") +def build(target_dir): + """Fill the site with demo content and build it.""" + prepare_demo_site(target_dir) + + patch_config( + target_dir, + ("# CREATE_MONTHLY_ARCHIVE = False", "CREATE_MONTHLY_ARCHIVE = True"), + ) + + with cd(target_dir): + __main__.main(["build"]) |
