Skip to content

Commit

Permalink
Merge pull request #113 from Guts/tests
Browse files Browse the repository at this point in the history
Unit testing enforced
  • Loading branch information
Guts authored Mar 29, 2022
2 parents 3539912 + 4fc26a7 commit b010121
Show file tree
Hide file tree
Showing 14 changed files with 432 additions and 15 deletions.
6 changes: 5 additions & 1 deletion tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ def get_plugin_config_from_mkdocs(
return plugin_loaded.config

def build_docs_setup(
self, testproject_path: Path, mkdocs_yml_filepath: Path, output_path: Path
self,
testproject_path: Path,
mkdocs_yml_filepath: Path,
output_path: Path,
strict: bool = True,
):
"""Runs the `mkdocs build` command.
Expand Down
4 changes: 3 additions & 1 deletion tests/fixtures/docs/page_with_meta.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
Title: Use the MkDocs RSS Plugin
date: 2020-03-20 10:20
description: First test page of mkdocs-rss-plugin test suite
tags:
- test
---

# First Test page
# Test page with meta

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.
File renamed without changes.
26 changes: 26 additions & 0 deletions tests/fixtures/mkdocs_feed_length_custom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Project information
site_name: MkDocs RSS Plugin - TEST
site_description: Basic setup to test against MkDocs RSS plugin
site_author: Julien Moura (Guts)
site_url: https://guts.github.io/mkdocs-rss-plugin
copyright: "Guts - In Geo Veritas"

# Repository
repo_name: "guts/mkdocs-rss-plugin"
repo_url: "https://github.com/guts/mkdocs-rss-plugin"

use_directory_urls: true

plugins:
- rss:
abstract_chars_count: 200
comments_path: "#__comments"
feed_ttl: 90
length: 3

theme:
name: readthedocs

# Extensions to enhance markdown
markdown_extensions:
- meta
23 changes: 23 additions & 0 deletions tests/fixtures/mkdocs_feed_ttl_custom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Project information
site_name: MkDocs RSS Plugin - TEST
site_description: Basic setup to test against MkDocs RSS plugin
site_author: Julien Moura (Guts)
site_url: https://guts.github.io/mkdocs-rss-plugin
copyright: "Guts - In Geo Veritas"

# Repository
repo_name: "guts/mkdocs-rss-plugin"
repo_url: "https://github.com/guts/mkdocs-rss-plugin"

use_directory_urls: true

plugins:
- rss:
feed_ttl: 90

theme:
name: readthedocs

# Extensions to enhance markdown
markdown_extensions:
- meta
24 changes: 24 additions & 0 deletions tests/fixtures/mkdocs_item_categories.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Project information
site_name: MkDocs RSS Plugin - TEST
site_description: Basic setup to test against MkDocs RSS plugin
site_author: Julien Moura (Guts)
site_url: https://guts.github.io/mkdocs-rss-plugin
copyright: 'Guts - In Geo Veritas'

# Repository
repo_name: 'guts/mkdocs-rss-plugin'
repo_url: 'https://github.com/guts/mkdocs-rss-plugin'

use_directory_urls: true

plugins:
- rss:
categories:
- tags

theme:
name: readthedocs

# Extensions to enhance markdown
markdown_extensions:
- meta
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ use_directory_urls: true

plugins:
- rss:
abstract_chars_count: 200
comments_path: "#__comments"
feed_ttl: 90
length: 3

theme:
name: readthedocs
Expand Down
24 changes: 24 additions & 0 deletions tests/fixtures/mkdocs_item_length_default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Project information
site_name: MkDocs RSS Plugin - TEST
site_description: Basic setup to test against MkDocs RSS plugin
site_author: Julien Moura (Guts)
site_url: https://guts.github.io/mkdocs-rss-plugin
copyright: "Guts - In Geo Veritas"

# Repository
repo_name: "guts/mkdocs-rss-plugin"
repo_url: "https://github.com/guts/mkdocs-rss-plugin"

docs_dir: docs

use_directory_urls: true

plugins:
- rss

theme:
name: readthedocs

# Extensions to enhance markdown
markdown_extensions:
- meta
23 changes: 23 additions & 0 deletions tests/fixtures/mkdocs_item_length_unlimited.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Project information
site_name: MkDocs RSS Plugin - TEST
site_description: Basic setup to test against MkDocs RSS plugin
site_author: Julien Moura (Guts)
site_url: https://guts.github.io/mkdocs-rss-plugin
copyright: "Guts - In Geo Veritas"

# Repository
repo_name: "guts/mkdocs-rss-plugin"
repo_url: "https://github.com/guts/mkdocs-rss-plugin"

use_directory_urls: true

plugins:
- rss:
abstract_chars_count: -1

theme:
name: readthedocs

# Extensions to enhance markdown
markdown_extensions:
- meta
22 changes: 22 additions & 0 deletions tests/fixtures/mkdocs_item_no_comments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Project information
site_name: MkDocs RSS Plugin - TEST
site_description: Basic setup to test against MkDocs RSS plugin
site_author: Julien Moura (Guts)
site_url: https://guts.github.io/mkdocs-rss-plugin
copyright: 'Guts - In Geo Veritas'

# Repository
repo_name: 'guts/mkdocs-rss-plugin'
repo_url: 'https://github.com/guts/mkdocs-rss-plugin'

use_directory_urls: true

plugins:
- rss

theme:
name: readthedocs

# Extensions to enhance markdown
markdown_extensions:
- meta
11 changes: 11 additions & 0 deletions tests/fixtures/mkdocs_minimal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
site_name: Test RSS Plugin
# site_description: Test RSS Plugin
site_url: https://guts.github.io/mkdocs-rss-plugin

use_directory_urls: true

plugins:
- rss

theme:
name: mkdocs
12 changes: 12 additions & 0 deletions tests/fixtures/mkdocs_pretty_print_disabled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
site_name: Test RSS Plugin
site_description: Test RSS Plugin

use_directory_urls: true

plugins:
- search
- rss:
pretty_print: False

theme:
name: mkdocs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ use_directory_urls: true

plugins:
- search
- rss
- rss:
pretty_print: True

theme:
name: mkdocs
Loading

0 comments on commit b010121

Please sign in to comment.