Skip to content

Commit d825cc9

Browse files
authored
Merge pull request #152 from Guts/tests/better-coverage
Tests: more use cases, better coverage
2 parents 478d1a9 + 9256d6e commit d825cc9

File tree

6 files changed

+41
-3
lines changed

6 files changed

+41
-3
lines changed

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ addopts =
4949
--cov-config=setup.cfg
5050
--cov=mkdocs_rss_plugin
5151
--cov-report=html
52+
--cov-report=term
5253
--cov-report=xml
5354
--ignore=tests/_wip/
5455
junit_family = xunit2
@@ -58,6 +59,7 @@ python_files = test_*.py
5859
testpaths = tests
5960

6061
[coverage:run]
62+
disable_warnings=include-ignored
6163
branch = True
6264
include =
6365
mkdocs_rss_plugin/*
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
date: 2022-03-30 15:09:34
3+
description: Test page with meta keys as singular and values as iterable
4+
---
5+
6+
# Test page with meta keys as singular
7+
8+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

tests/fixtures/mkdocs_complete.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ plugins:
3535
utm_campaign: "feed-syndication"
3636
theme:
3737
name: readthedocs
38+
locale: fr
3839

3940
# Extensions to enhance markdown
4041
markdown_extensions:

tests/fixtures/mkdocs_item_categories.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ site_name: MkDocs RSS Plugin - TEST
33
site_description: Basic setup to test against MkDocs RSS plugin
44
site_author: Julien Moura (Guts)
55
site_url: https://guts.github.io/mkdocs-rss-plugin
6-
copyright: 'Guts - In Geo Veritas'
6+
copyright: "Guts - In Geo Veritas"
77

88
# Repository
9-
repo_name: 'guts/mkdocs-rss-plugin'
10-
repo_url: 'https://github.com/guts/mkdocs-rss-plugin'
9+
repo_name: "guts/mkdocs-rss-plugin"
10+
repo_url: "https://github.com/guts/mkdocs-rss-plugin"
1111

1212
use_directory_urls: true
1313

@@ -18,6 +18,7 @@ plugins:
1818

1919
theme:
2020
name: readthedocs
21+
language: de
2122

2223
# Extensions to enhance markdown
2324
markdown_extensions:
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
site_name: Test RSS Plugin
2+
site_description: Test RSS Plugin
3+
# site_url: https://guts.github.io/mkdocs-rss-plugin
4+
5+
use_directory_urls: true
6+
7+
plugins:
8+
- rss
9+
10+
theme:
11+
name: mkdocs

tests/test_build.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,21 @@ def test_rss_feed_validation(self):
401401
# some feed characteristics
402402
self.assertEqual(feed_parsed.version, "rss20")
403403

404+
def test_config_no_site_url(self):
405+
with tempfile.TemporaryDirectory() as tmpdirname:
406+
cli_result = self.build_docs_setup(
407+
testproject_path="docs",
408+
mkdocs_yml_filepath=Path(
409+
"tests/fixtures/mkdocs_minimal_no_site_url.yml"
410+
),
411+
output_path=tmpdirname,
412+
strict=True,
413+
)
414+
415+
# cli should returns an error code (1)
416+
self.assertEqual(cli_result.exit_code, 1)
417+
self.assertIsNotNone(cli_result.exception)
418+
404419
def test_bad_config(self):
405420
with tempfile.TemporaryDirectory() as tmpdirname:
406421
cli_result = self.build_docs_setup(

0 commit comments

Comments
 (0)