From 9b0ee130c7408e839ceaa0de97a12c9da35e216f Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Sat, 30 Aug 2025 19:33:04 +0200 Subject: g2h: Link subdir names in tree page Files are also clickable already but no file page yet --- tests/tree_test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/tree_test.py') diff --git a/tests/tree_test.py b/tests/tree_test.py index ebad5e5..e7d23a8 100644 --- a/tests/tree_test.py +++ b/tests/tree_test.py @@ -43,12 +43,15 @@ def add_node(parent, path): def test_context_empty(): commit = MagicMock() commit.hexsha = '123' + commit.tree.path = 'tree/path' page = TreePage('test/tree', 'tree test', commit, '', None, '') context = page.context() assert(context['entries'] == []) + assert(context['content_subdir'] == '') + assert(context['subdir'] == '/123/t/tree/path') assert(context['title'] == 'tree test: Tree') -def test_context_filled(): +def test_context_entries(): tree = MagicMock() tree.trees = [] tree.blobs = [] @@ -65,7 +68,6 @@ def test_context_filled(): page = TreePage('test/tree', 'tree test', commit, '', repo, '') context = page.context() assert(repo.iter_commits.called) - assert(context['title'] == 'tree test: Tree') assert(context['entries'] == [{'name': 'sub/', 'modified': 'Date Time'}, {'name': 'README', 'modified': 'Date Time'}]) def test_traversal(): -- cgit v1.2.3