remove unused request_path_to_breadcrumb_display
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
This commit is contained in:
parent
204e7bc416
commit
9b7ab74644
@ -192,10 +192,3 @@ def generate_parent_navs(path, pages_root: str):
|
|||||||
return generate_parent_navs(parent_resource_path, pages_root) + [(page_name, request_path)]
|
return generate_parent_navs(parent_resource_path, pages_root) + [(page_name, request_path)]
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
return generate_parent_navs(parent_resource_path, pages_root) + [(request_path, request_path)]
|
return generate_parent_navs(parent_resource_path, pages_root) + [(request_path, request_path)]
|
||||||
|
|
||||||
|
|
||||||
def request_path_to_breadcrumb_display(path):
|
|
||||||
"""Given a request path, e.g. "/foo/bar/baz/", turn it into breadcrumby text "baz"."""
|
|
||||||
undired = path.rstrip('/')
|
|
||||||
leaf = undired[undired.rfind('/'):]
|
|
||||||
return leaf.strip('/')
|
|
||||||
|
|||||||
@ -10,8 +10,7 @@ import pytest
|
|||||||
|
|
||||||
from incorporealcms import init_instance
|
from incorporealcms import init_instance
|
||||||
from incorporealcms.markdown import (generate_parent_navs, handle_markdown_file_path,
|
from incorporealcms.markdown import (generate_parent_navs, handle_markdown_file_path,
|
||||||
instance_resource_path_to_request_path, parse_md,
|
instance_resource_path_to_request_path, parse_md)
|
||||||
request_path_to_breadcrumb_display)
|
|
||||||
|
|
||||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||||
INSTANCE_DIR = os.path.join(HERE, 'instance')
|
INSTANCE_DIR = os.path.join(HERE, 'instance')
|
||||||
@ -130,15 +129,6 @@ def test_instance_resource_path_to_request_path_on_subdir_and_page():
|
|||||||
assert instance_resource_path_to_request_path('subdir/page.md') == '/subdir/page'
|
assert instance_resource_path_to_request_path('subdir/page.md') == '/subdir/page'
|
||||||
|
|
||||||
|
|
||||||
def test_request_path_to_breadcrumb_display_patterns():
|
|
||||||
"""Test various conversions from request path to leaf nodes for display in the breadcrumbs."""
|
|
||||||
assert request_path_to_breadcrumb_display('/foo') == 'foo'
|
|
||||||
assert request_path_to_breadcrumb_display('/foo/') == 'foo'
|
|
||||||
assert request_path_to_breadcrumb_display('/foo/bar') == 'bar'
|
|
||||||
assert request_path_to_breadcrumb_display('/foo/bar/') == 'bar'
|
|
||||||
assert request_path_to_breadcrumb_display('/') == ''
|
|
||||||
|
|
||||||
|
|
||||||
def test_parse_md_metadata():
|
def test_parse_md_metadata():
|
||||||
"""Test the direct results of parsing a markdown file."""
|
"""Test the direct results of parsing a markdown file."""
|
||||||
content, md, page_name, page_title, page_desc, mtime = parse_md(
|
content, md, page_name, page_title, page_desc, mtime = parse_md(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user