diff options
| author | Christoph Schlosser <christoph@linux.com> | 2025-08-30 19:33:04 +0200 |
|---|---|---|
| committer | Christoph Schlosser <christoph@linux.com> | 2025-08-30 19:33:04 +0200 |
| commit | 9b0ee130c7408e839ceaa0de97a12c9da35e216f (patch) | |
| tree | ca4d84897b7ae951d1dcea895dae08a0222a5f33 /tests | |
| parent | f2c9a0297324c8a6be2cb0b58d0c12c2f3406529 (diff) | |
| download | git2hugo-9b0ee130c7408e839ceaa0de97a12c9da35e216f.tar.gz | |
g2h: Link subdir names in tree page
Files are also clickable already but no file page yet
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/tree_test.py | 6 |
1 files changed, 4 insertions, 2 deletions
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(): |