Skip to content

Commit d91b143

Browse files
committed
Test against item length
1 parent 344e3e4 commit d91b143

3 files changed

Lines changed: 73 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Project information
2+
site_name: MkDocs RSS Plugin - TEST
3+
site_description: Basic setup to test against MkDocs RSS plugin
4+
site_author: Julien Moura (Guts)
5+
site_url: https://guts.github.io/mkdocs-rss-plugin
6+
copyright: "Guts - In Geo Veritas"
7+
8+
# Repository
9+
repo_name: "guts/mkdocs-rss-plugin"
10+
repo_url: "https://github.com/guts/mkdocs-rss-plugin"
11+
12+
docs_dir: docs
13+
14+
use_directory_urls: true
15+
16+
plugins:
17+
- rss
18+
19+
theme:
20+
name: readthedocs
21+
22+
# Extensions to enhance markdown
23+
markdown_extensions:
24+
- meta
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Project information
2+
site_name: MkDocs RSS Plugin - TEST
3+
site_description: Basic setup to test against MkDocs RSS plugin
4+
site_author: Julien Moura (Guts)
5+
site_url: https://guts.github.io/mkdocs-rss-plugin
6+
copyright: "Guts - In Geo Veritas"
7+
8+
# Repository
9+
repo_name: "guts/mkdocs-rss-plugin"
10+
repo_url: "https://github.com/guts/mkdocs-rss-plugin"
11+
12+
use_directory_urls: true
13+
14+
plugins:
15+
- rss:
16+
abstract_chars_count: -1
17+
18+
theme:
19+
name: readthedocs
20+
21+
# Extensions to enhance markdown
22+
markdown_extensions:
23+
- meta

tests/test_build.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,32 @@ def test_simple_build_feed_length(self):
116116

117117
self.assertEqual(len(feed_parsed.entries), 3)
118118

119+
def test_simple_build_item_length_unlimited(self):
120+
with tempfile.TemporaryDirectory() as tmpdirname:
121+
cli_result = self.build_docs_setup(
122+
testproject_path="docs",
123+
mkdocs_yml_filepath=Path(
124+
"tests/fixtures/mkdocs_item_length_unlimited.yml"
125+
),
126+
output_path=tmpdirname,
127+
strict=True,
128+
)
129+
if cli_result.exception is not None:
130+
e = cli_result.exception
131+
logger.debug(format_exception(type(e), e, e.__traceback__))
132+
133+
self.assertEqual(cli_result.exit_code, 0)
134+
self.assertIsNone(cli_result.exception)
135+
136+
# created items
137+
feed_parsed = feedparser.parse(Path(tmpdirname) / "feed_rss_created.xml")
138+
self.assertEqual(feed_parsed.bozo, 0)
139+
140+
for item in feed_parsed.entries:
141+
print(item.title, len(item.description))
142+
if item.title not in ("Page without meta with short text",):
143+
self.assertGreaterEqual(len(item.description), 150)
144+
119145
def test_rss_feed_validation(self):
120146
with tempfile.TemporaryDirectory() as tmpdirname:
121147
cli_result = self.build_docs_setup(

0 commit comments

Comments
 (0)