소스 검색

Cope with diffstat not being present in test_patch.

Jelmer Vernooij 15 년 전
부모
커밋
0642f217c2
1개의 변경된 파일6개의 추가작업 그리고 3개의 파일을 삭제
  1. 6 3
      dulwich/tests/test_patch.py

+ 6 - 3
dulwich/tests/test_patch.py

@@ -51,8 +51,11 @@ class WriteCommitPatchTests(TestCase):
             "And this is the second line.\n",
             "\n",
             "\n",
-            "---\n",
-            " 0 files changed\n",
+            "---\n"], lines[3:8])
+        self.assertEquals([
             "\n",
             "CONTENTS-- \n",
-            "custom\n"], lines[3:])
+            "custom\n"], lines[-3:])
+        if len(lines) >= 12:
+            # diffstat may not be present
+            self.assertEquals(lines[8], " 0 files changed\n")