aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/content/tests/helpers.py
diff options
context:
space:
mode:
authorGravatar kosayoda <[email protected]>2021-03-29 19:12:51 +0800
committerGravatar kosayoda <[email protected]>2021-03-29 19:12:51 +0800
commit61fafa2e42a7eaff28f9d30853b044949d299798 (patch)
tree4374b403474a64520dfba81bd985771c45cd5706 /pydis_site/apps/content/tests/helpers.py
parentFix failing tests. (diff)
Add new tests to achieve full coverage.
Diffstat (limited to 'pydis_site/apps/content/tests/helpers.py')
-rw-r--r--pydis_site/apps/content/tests/helpers.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/pydis_site/apps/content/tests/helpers.py b/pydis_site/apps/content/tests/helpers.py
index be91b95a..59cd3bd6 100644
--- a/pydis_site/apps/content/tests/helpers.py
+++ b/pydis_site/apps/content/tests/helpers.py
@@ -8,6 +8,7 @@ description: TestDescription
relevant_links:
Python Discord: https://pythondiscord.com
Discord: https://discord.com
+toc: 0
---
# This is a header.
"""
@@ -32,7 +33,8 @@ PARSED_METADATA = {
"relevant_links": {
"Python Discord": "https://pythondiscord.com",
"Discord": "https://discord.com"
- }
+ },
+ "toc": 0
}
# The YAML data parsed from the above _info.yml file
@@ -50,7 +52,10 @@ class MockPagesTestCase(TestCase):
├── not_a_page.md
├── tmp
|   ├── _info.yml
- |   └── category_without_info
+ |   ├── tmp.md
+ |   └── category
+ |    ├── _info.yml
+ |      └── subcategory_without_info
└── category
   ├── _info.yml
   ├── with_metadata.md
@@ -81,4 +86,6 @@ class MockPagesTestCase(TestCase):
# for testing purposes.
# See: https://jmcgeheeiv.github.io/pyfakefs/release/usage.html#os-temporary-directories
self.fs.create_file("tmp/_info.yml", contents=CATEGORY_INFO)
- self.fs.create_dir("tmp/category_without_info")
+ self.fs.create_file("tmp/tmp.md", contents=MARKDOWN_WITH_METADATA)
+ self.fs.create_file("tmp/category/_info.yml", contents=MARKDOWN_WITH_METADATA)
+ self.fs.create_dir("tmp/category/subcategory_without_info")