diff options
Diffstat (limited to 'tests/log_test.py')
| -rw-r--r-- | tests/log_test.py | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/tests/log_test.py b/tests/log_test.py index c0619de..041544e 100644 --- a/tests/log_test.py +++ b/tests/log_test.py @@ -21,7 +21,7 @@ def test_context_no_branches_and_tags(): page = LogPage('test/log', 'log test', [commit], None, None, '') context = page.context() assert(context['title'] == 'log test: Log') - assert(context['commits'] == [{'committed_datetime': 0, 'refs': [], 'summary': 'mock commit'}]) + assert(context['commits'] == [{'committed_datetime': 0, 'hexsha': 1234, 'refs': [], 'summary': 'mock commit'}]) def test_context_matching_branch_no_tags(): commit = MagicMock() @@ -34,7 +34,7 @@ def test_context_matching_branch_no_tags(): page = LogPage('test/log', 'log test', [commit], [branch], None, '') context = page.context() assert(context['title'] == 'log test: Log') - assert(context['commits'] == [{'committed_datetime': 0, 'refs': ['mock branch'], 'summary': 'mock commit'}]) + assert(context['commits'] == [{'committed_datetime': 0, 'hexsha': 1234, 'refs': ['mock branch'], 'summary': 'mock commit'}]) def test_context_unmatching_branch_no_tags(): commit = MagicMock() @@ -47,7 +47,7 @@ def test_context_unmatching_branch_no_tags(): page = LogPage('test/log', 'log test', [commit], [branch], None, '') context = page.context() assert(context['title'] == 'log test: Log') - assert(context['commits'] == [{'committed_datetime': 0, 'refs': [], 'summary': 'mock commit'}]) + assert(context['commits'] == [{'committed_datetime': 0, 'hexsha': 1234, 'refs': [], 'summary': 'mock commit'}]) def test_context_no_branch_matching_tag(): commit = MagicMock() @@ -59,8 +59,7 @@ def test_context_no_branch_matching_tag(): tag.name = 'mock tag' page = LogPage('test/log', 'log test', [commit], None, [tag], '') context = page.context() - assert(context['title'] == 'log test: Log') - assert(context['commits'] == [{'committed_datetime': 0, 'refs': ['mock tag'], 'summary': 'mock commit'}]) + assert(context['commits'] == [{'committed_datetime': 0, 'hexsha': 1234, 'refs': ['mock tag'], 'summary': 'mock commit'}]) def test_context_no_branch_no_matching_tag(): commit = MagicMock() @@ -73,7 +72,7 @@ def test_context_no_branch_no_matching_tag(): page = LogPage('test/log', 'log test', [commit], None, [tag], '') context = page.context() assert(context['title'] == 'log test: Log') - assert(context['commits'] == [{'committed_datetime': 0, 'refs': [], 'summary': 'mock commit'}]) + assert(context['commits'] == [{'committed_datetime': 0, 'hexsha': 1234, 'refs': [], 'summary': 'mock commit'}]) def test_context_no_matching_branch_no_matching_tag(): commit = MagicMock() @@ -89,7 +88,7 @@ def test_context_no_matching_branch_no_matching_tag(): page = LogPage('test/log', 'log test', [commit], [branch], [tag], '') context = page.context() assert(context['title'] == 'log test: Log') - assert(context['commits'] == [{'committed_datetime': 0, 'refs': [], 'summary': 'mock commit'}]) + assert(context['commits'] == [{'committed_datetime': 0, 'hexsha': 1234, 'refs': [], 'summary': 'mock commit'}]) def test_context_matching_branch_matching_tag(): commit = MagicMock() @@ -105,7 +104,7 @@ def test_context_matching_branch_matching_tag(): page = LogPage('test/log', 'log test', [commit], [branch], [tag], '') context = page.context() assert(context['title'] == 'log test: Log') - assert(context['commits'] == [{'committed_datetime': 0, 'refs': ['mock branch', 'mock tag'], 'summary': 'mock commit'}]) + assert(context['commits'] == [{'committed_datetime': 0, 'hexsha': 1234, 'refs': ['mock branch', 'mock tag'], 'summary': 'mock commit'}]) def test_multiple_commits(): commit1 = MagicMock() @@ -120,8 +119,8 @@ def test_multiple_commits(): context = page.context() assert(context['title'] == 'log test: Log') assert(context['commits'] == [ - {'committed_datetime': 0, 'refs': [], 'summary': 'mock commit 1'}, - {'committed_datetime': 1, 'refs': [], 'summary': 'mock commit 2'} + {'committed_datetime': 0, 'hexsha': 1, 'refs': [], 'summary': 'mock commit 1'}, + {'committed_datetime': 1, 'hexsha': 2, 'refs': [], 'summary': 'mock commit 2'} ]) def test_multiple_commits_branch(): @@ -140,8 +139,8 @@ def test_multiple_commits_branch(): context = page.context() assert(context['title'] == 'log test: Log') assert(context['commits'] == [ - {'committed_datetime': 0, 'refs': ['mock branch'], 'summary': 'mock commit 1'}, - {'committed_datetime': 1, 'refs': [], 'summary': 'mock commit 2'} + {'committed_datetime': 0, 'hexsha': 1, 'refs': ['mock branch'], 'summary': 'mock commit 1'}, + {'committed_datetime': 1, 'hexsha': 2, 'refs': [], 'summary': 'mock commit 2'} ]) def test_multiple_commits_tag(): @@ -160,8 +159,8 @@ def test_multiple_commits_tag(): context = page.context() assert(context['title'] == 'log test: Log') assert(context['commits'] == [ - {'committed_datetime': 0, 'refs': ['mock tag'], 'summary': 'mock commit 1'}, - {'committed_datetime': 1, 'refs': [], 'summary': 'mock commit 2'} + {'committed_datetime': 0, 'hexsha': 1, 'refs': ['mock tag'], 'summary': 'mock commit 1'}, + {'committed_datetime': 1, 'hexsha': 2, 'refs': [], 'summary': 'mock commit 2'} ]) def test_multiple_commits_branch_and_tag(): @@ -183,7 +182,7 @@ def test_multiple_commits_branch_and_tag(): context = page.context() assert(context['title'] == 'log test: Log') assert(context['commits'] == [ - {'committed_datetime': 0, 'refs': ['mock branch'], 'summary': 'mock commit 1'}, - {'committed_datetime': 1, 'refs': ['mock tag'], 'summary': 'mock commit 2'} + {'committed_datetime': 0, 'hexsha': 1, 'refs': ['mock branch'], 'summary': 'mock commit 1'}, + {'committed_datetime': 1, 'hexsha': 2, 'refs': ['mock tag'], 'summary': 'mock commit 2'} ]) |