@@ -589,13 +589,9 @@ def test_git_oneline_rm(self):
589
589
self .assertEqual (results , expected )
590
590
591
591
def test_git_header (self ):
592
- text = """
593
- diff --git a/bugtrace/patch.py b/bugtrace/patch.py
594
- index 8910dfd..456e34f 100644
595
- --- a/bugtrace/patch.py
596
- +++ b/bugtrace/patch.py
597
- @@ -8,20 +8,30 @@
598
- """
592
+ with open ('tests/casefiles/git-header.diff' ) as f :
593
+ text = f .read ()
594
+
599
595
expected = wtp .patch .header (
600
596
index_path = None ,
601
597
old_path = 'bugtrace/patch.py' ,
@@ -610,13 +606,9 @@ def test_git_header(self):
610
606
self .assertEqual (results_main , expected )
611
607
612
608
def test_svn_header (self ):
613
- text = """
614
- Index: bugtrace/trunk/src/bugtrace/csc.py
615
- ===================================================================
616
- --- bugtrace/trunk/src/bugtrace/csc.py (revision 12783)
617
- +++ bugtrace/trunk/src/bugtrace/csc.py (revision 12784)
618
- @@ -1,3 +1,6 @@
619
- """
609
+ with open ('tests/casefiles/svn-header.diff' ) as f :
610
+ text = f .read ()
611
+
620
612
expected = wtp .patch .header (
621
613
index_path = 'bugtrace/trunk/src/bugtrace/csc.py' ,
622
614
old_path = 'bugtrace/trunk/src/bugtrace/csc.py' ,
@@ -630,16 +622,9 @@ def test_svn_header(self):
630
622
self .assertEqual (results_main , expected )
631
623
632
624
def test_cvs_header (self ):
633
- text = """Index: org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/SafeChunkyInputStream.java
634
- ===================================================================
635
- RCS file: /cvsroot/eclipse/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/SafeChunkyInputStream.java,v
636
- retrieving revision 1.6.4.1
637
- retrieving revision 1.8
638
- diff -u -r1.6.4.1 -r1.8
639
- --- org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/SafeChunkyInputStream.java 23 Jul 2001 17:51:45 -0000 1.6.4.1
640
- +++ org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/SafeChunkyInputStream.java 17 May 2002 20:27:56 -0000 1.8
641
- @@ -1 +1 @@
642
- """
625
+ with open ('tests/casefiles/cvs-header.diff' ) as f :
626
+ text = f .read ()
627
+
643
628
expected = wtp .patch .header (
644
629
index_path = 'org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/SafeChunkyInputStream.java' ,
645
630
old_path = 'org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/SafeChunkyInputStream.java' ,
@@ -653,9 +638,8 @@ def test_cvs_header(self):
653
638
self .assertEqual (results_main , expected )
654
639
655
640
def test_unified_header (self ):
656
- text = """--- /tmp/o 2012-12-22 06:43:35.000000000 -0600
657
- +++ /tmp/n 2012-12-23 20:40:50.000000000 -0600
658
- @@ -1,3 +1,9 @@"""
641
+ with open ('tests/casefiles/unified-header.diff' ) as f :
642
+ text = f .read ()
659
643
660
644
expected = wtp .patch .header (
661
645
index_path = None ,
@@ -671,9 +655,8 @@ def test_unified_header(self):
671
655
self .assertEqual (results_main , expected )
672
656
673
657
def test_unified_header_notab (self ):
674
- text = """--- /tmp/some file 2012-12-22 06:43:35.000000000 -0600
675
- +++ /tmp/n 2012-12-23 20:40:50.000000000 -0600
676
- @@ -1,3 +1,9 @@"""
658
+ with open ('tests/casefiles/unified-header-notab.diff' ) as f :
659
+ text = f .read ()
677
660
678
661
expected = wtp .patch .header (
679
662
index_path = None ,
@@ -807,7 +790,6 @@ def test_diff_default_blah(self):
807
790
with open ('tests/casefiles/diff-default-blah.diff' ) as f :
808
791
text = f .read ()
809
792
810
-
811
793
expected = [
812
794
wtp .patch .diffobj (
813
795
header = None ,
@@ -836,9 +818,9 @@ def test_diff_default_blah(self):
836
818
837
819
838
820
def test_context_header (self ):
839
- text = """*** /tmp/o 2012-12-22 06:43:35.000000000 -0600
840
- --- /tmp/n 2012-12-23 20:40:50.000000000 -0600
841
- ***************"""
821
+ with open ( 'tests/casefiles/context-header.diff' ) as f :
822
+ text = f . read ()
823
+
842
824
843
825
expected = wtp .patch .header (
844
826
index_path = None ,
0 commit comments