summaryrefslogtreecommitdiffstats
path: root/tests/file_page_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/file_page_test.py')
-rw-r--r--tests/file_page_test.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/file_page_test.py b/tests/file_page_test.py
index 5bd2f6d..daa9b6c 100644
--- a/tests/file_page_test.py
+++ b/tests/file_page_test.py
@@ -60,6 +60,7 @@ def test_context_dot_file():
assert(context['title'] == 'file test: .file')
assert(context['type'] == 'text')
assert(context['breadcrumbs'] == '[/](/file/content/123/t/)/[.file](/file/content/123/t/_file)')
+ assert(context['backtick_max'] == 3)
def test_bytes_to_content_text():
content, type = bytes_to_content('test'.encode())
@@ -82,3 +83,14 @@ def test_bytes_to_content_bin():
assert(content == None)
assert(type == None)
+def test_backticks_in_text_content():
+ file = MagicMock()
+ tree = MagicMock()
+ commit = MagicMock()
+ commit.hexsha = '123'
+ commit.tree = tree
+ commit.tree.join.return_value = file
+ page = FilePage('test/file', 'file test', commit, '.file', '', 'file/content')
+ file.data_stream.read.return_value = '```'.encode()
+ context = page.context()
+ assert(context['backtick_max'] == 4)