blob: 1d94acf38de68d1beb27c3f34d15fd3915255fac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
from unittest.mock import Mock
from g2h.overview_page import OverviewPage
def test_init():
commit = Mock()
commit.committed_datetime = '2025-04-01T12:34:56+00:00'
page = OverviewPage('test/overview', 'overview test', 'test branch', 'test tag', 'overview/sub/dir', commit)
context = page.context()
assert(context['title'] == 'overview test')
assert(context['branches'] == 'test branch')
assert(context['tags'] == 'test tag')
assert(context['content_subdir'] == 'overview/sub/dir')
assert(context['latest_commit_date'] == '2025-04-01T12:34:56+00:00')
|