Browse Source

Cope with diffstat not being present in test_patch.

Jelmer Vernooij 15 năm trước cách đây
mục cha
commit
29fa1963d9
1 tập tin đã thay đổi với 6 bổ sung3 xóa
  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")