26
26
import os .path as osp
27
27
28
28
29
+ def to_raw (input ):
30
+ return input .replace (b'\t ' , b'\x00 ' )
31
+
32
+
29
33
@ddt .ddt
30
34
class TestDiff (TestBase ):
31
35
@@ -112,7 +116,7 @@ def test_diff_with_rename(self):
112
116
self .assertEqual (diff .raw_rename_to , b'm\xc3 \xbc ller' )
113
117
assert isinstance (str (diff ), str )
114
118
115
- output = StringProcessAdapter (fixture ('diff_rename_raw' ))
119
+ output = StringProcessAdapter (to_raw ( fixture ('diff_rename_raw' ) ))
116
120
diffs = Diff ._index_from_raw_format (self .rorepo , output )
117
121
self .assertEqual (len (diffs ), 1 )
118
122
diff = diffs [0 ]
@@ -137,7 +141,7 @@ def test_diff_with_copied_file(self):
137
141
self .assertTrue (diff .b_path , 'test2.txt' )
138
142
assert isinstance (str (diff ), str )
139
143
140
- output = StringProcessAdapter (fixture ('diff_copied_mode_raw' ))
144
+ output = StringProcessAdapter (to_raw ( fixture ('diff_copied_mode_raw' ) ))
141
145
diffs = Diff ._index_from_raw_format (self .rorepo , output )
142
146
self .assertEqual (len (diffs ), 1 )
143
147
diff = diffs [0 ]
@@ -165,7 +169,7 @@ def test_diff_with_change_in_type(self):
165
169
self .assertIsNotNone (diff .new_file )
166
170
assert isinstance (str (diff ), str )
167
171
168
- output = StringProcessAdapter (fixture ('diff_change_in_type_raw' ))
172
+ output = StringProcessAdapter (to_raw ( fixture ('diff_change_in_type_raw' ) ))
169
173
diffs = Diff ._index_from_raw_format (self .rorepo , output )
170
174
self .assertEqual (len (diffs ), 1 )
171
175
diff = diffs [0 ]
@@ -175,7 +179,7 @@ def test_diff_with_change_in_type(self):
175
179
self .assertEqual (len (list (diffs .iter_change_type ('T' ))), 1 )
176
180
177
181
def test_diff_of_modified_files_not_added_to_the_index (self ):
178
- output = StringProcessAdapter (fixture ('diff_abbrev-40_full-index_M_raw_no-color' ))
182
+ output = StringProcessAdapter (to_raw ( fixture ('diff_abbrev-40_full-index_M_raw_no-color' ) ))
179
183
diffs = Diff ._index_from_raw_format (self .rorepo , output )
180
184
181
185
self .assertEqual (len (diffs ), 1 , 'one modification' )
0 commit comments