Skip to content

Commit 1b456f0

Browse files
committed
Add test case for long git commit ids.
1 parent 08840f4 commit 1b456f0

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
diff --git a/bugtrace/patch.py b/bugtrace/patch.py
2+
index 18910dfd..2456e34f 100644
3+
--- a/bugtrace/patch.py
4+
+++ b/bugtrace/patch.py
5+
@@ -8,20 +8,30 @@
6+

tests/test_patch.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,23 @@ def test_git_header(self):
603603
results_main = wtp.patch.parse_header(text)
604604
self.assertEqual(results_main, expected)
605605

606+
def test_git_header_long(self):
607+
with open('tests/casefiles/git-header-long.diff') as f:
608+
text = f.read()
609+
610+
expected = wtp.patch.header(
611+
index_path = None,
612+
old_path = 'bugtrace/patch.py',
613+
old_version = '18910dfd',
614+
new_path = 'bugtrace/patch.py',
615+
new_version = '2456e34f')
616+
617+
results = wtp.patch.parse_git_header(text)
618+
self.assertEqual(results, expected)
619+
620+
results_main = wtp.patch.parse_header(text)
621+
self.assertEqual(results_main, expected)
622+
606623
def test_svn_header(self):
607624
with open('tests/casefiles/svn-header.diff') as f:
608625
text = f.read()

0 commit comments

Comments
 (0)