@@ -106,8 +106,8 @@ def test_diff_with_rename(self):
106
106
diff = diffs [0 ]
107
107
self .assertTrue (diff .renamed_file )
108
108
self .assertTrue (diff .renamed )
109
- self .assertEqual (diff .rename_from , u 'Jérôme' )
110
- self .assertEqual (diff .rename_to , u 'müller' )
109
+ self .assertEqual (diff .rename_from , 'Jérôme' )
110
+ self .assertEqual (diff .rename_to , 'müller' )
111
111
self .assertEqual (diff .raw_rename_from , b'J\xc3 \xa9 r\xc3 \xb4 me' )
112
112
self .assertEqual (diff .raw_rename_to , b'm\xc3 \xbc ller' )
113
113
assert isinstance (str (diff ), str )
@@ -133,8 +133,8 @@ def test_diff_with_copied_file(self):
133
133
134
134
diff = diffs [0 ]
135
135
self .assertTrue (diff .copied_file )
136
- self .assertTrue (diff .a_path , u 'test1.txt' )
137
- self .assertTrue (diff .b_path , u 'test2.txt' )
136
+ self .assertTrue (diff .a_path , 'test1.txt' )
137
+ self .assertTrue (diff .b_path , 'test2.txt' )
138
138
assert isinstance (str (diff ), str )
139
139
140
140
output = StringProcessAdapter (fixture ('diff_copied_mode_raw' ))
@@ -143,8 +143,8 @@ def test_diff_with_copied_file(self):
143
143
diff = diffs [0 ]
144
144
self .assertEqual (diff .change_type , 'C' )
145
145
self .assertEqual (diff .score , 100 )
146
- self .assertEqual (diff .a_path , u 'test1.txt' )
147
- self .assertEqual (diff .b_path , u 'test2.txt' )
146
+ self .assertEqual (diff .a_path , 'test1.txt' )
147
+ self .assertEqual (diff .b_path , 'test2.txt' )
148
148
self .assertEqual (len (list (diffs .iter_change_type ('C' ))), 1 )
149
149
150
150
def test_diff_with_change_in_type (self ):
@@ -237,29 +237,29 @@ def test_diff_unsafe_paths(self):
237
237
res = Diff ._index_from_patch_format (None , output )
238
238
239
239
# The "Additions"
240
- self .assertEqual (res [0 ].b_path , u 'path/ starting with a space' )
241
- self .assertEqual (res [1 ].b_path , u 'path/"with-quotes"' )
242
- self .assertEqual (res [2 ].b_path , u "path/'with-single-quotes'" )
243
- self .assertEqual (res [3 ].b_path , u 'path/ending in a space ' )
244
- self .assertEqual (res [4 ].b_path , u 'path/with\t tab' )
245
- self .assertEqual (res [5 ].b_path , u 'path/with\n newline' )
246
- self .assertEqual (res [6 ].b_path , u 'path/with spaces' )
247
- self .assertEqual (res [7 ].b_path , u 'path/with-question-mark?' )
248
- self .assertEqual (res [8 ].b_path , u 'path/¯\\ _(ツ)_|¯' )
249
- self .assertEqual (res [9 ].b_path , u 'path/💩.txt' )
240
+ self .assertEqual (res [0 ].b_path , 'path/ starting with a space' )
241
+ self .assertEqual (res [1 ].b_path , 'path/"with-quotes"' )
242
+ self .assertEqual (res [2 ].b_path , "path/'with-single-quotes'" )
243
+ self .assertEqual (res [3 ].b_path , 'path/ending in a space ' )
244
+ self .assertEqual (res [4 ].b_path , 'path/with\t tab' )
245
+ self .assertEqual (res [5 ].b_path , 'path/with\n newline' )
246
+ self .assertEqual (res [6 ].b_path , 'path/with spaces' )
247
+ self .assertEqual (res [7 ].b_path , 'path/with-question-mark?' )
248
+ self .assertEqual (res [8 ].b_path , 'path/¯\\ _(ツ)_|¯' )
249
+ self .assertEqual (res [9 ].b_path , 'path/💩.txt' )
250
250
self .assertEqual (res [9 ].b_rawpath , b'path/\xf0 \x9f \x92 \xa9 .txt' )
251
- self .assertEqual (res [10 ].b_path , u 'path/�-invalid-unicode-path.txt' )
251
+ self .assertEqual (res [10 ].b_path , 'path/�-invalid-unicode-path.txt' )
252
252
self .assertEqual (res [10 ].b_rawpath , b'path/\x80 -invalid-unicode-path.txt' )
253
253
254
254
# The "Moves"
255
255
# NOTE: The path prefixes a/ and b/ here are legit! We're actually
256
256
# verifying that it's not "a/a/" that shows up, see the fixture data.
257
- self .assertEqual (res [11 ].a_path , u 'a/with spaces' ) # NOTE: path a/ here legit!
258
- self .assertEqual (res [11 ].b_path , u 'b/with some spaces' ) # NOTE: path b/ here legit!
259
- self .assertEqual (res [12 ].a_path , u 'a/ending in a space ' )
260
- self .assertEqual (res [12 ].b_path , u 'b/ending with space ' )
261
- self .assertEqual (res [13 ].a_path , u 'a/"with-quotes"' )
262
- self .assertEqual (res [13 ].b_path , u 'b/"with even more quotes"' )
257
+ self .assertEqual (res [11 ].a_path , 'a/with spaces' ) # NOTE: path a/ here legit!
258
+ self .assertEqual (res [11 ].b_path , 'b/with some spaces' ) # NOTE: path b/ here legit!
259
+ self .assertEqual (res [12 ].a_path , 'a/ending in a space ' )
260
+ self .assertEqual (res [12 ].b_path , 'b/ending with space ' )
261
+ self .assertEqual (res [13 ].a_path , 'a/"with-quotes"' )
262
+ self .assertEqual (res [13 ].b_path , 'b/"with even more quotes"' )
263
263
264
264
def test_diff_patch_format (self ):
265
265
# test all of the 'old' format diffs for completness - it should at least
@@ -277,7 +277,7 @@ def test_diff_with_spaces(self):
277
277
data = StringProcessAdapter (fixture ('diff_file_with_spaces' ))
278
278
diff_index = Diff ._index_from_patch_format (self .rorepo , data )
279
279
self .assertIsNone (diff_index [0 ].a_path , repr (diff_index [0 ].a_path ))
280
- self .assertEqual (diff_index [0 ].b_path , u 'file with spaces' , repr (diff_index [0 ].b_path ))
280
+ self .assertEqual (diff_index [0 ].b_path , 'file with spaces' , repr (diff_index [0 ].b_path ))
281
281
282
282
def test_diff_submodule (self ):
283
283
"""Test that diff is able to correctly diff commits that cover submodule changes"""
0 commit comments