@@ -419,7 +419,7 @@ def test_rename_override(self, rw_dir):
419
419
# create and commit file_a.txt
420
420
repo = Repo .init (rw_dir )
421
421
file_a = osp .join (rw_dir , "file_a.txt" )
422
- with open (file_a , "w" , encoding = ' utf-8' ) as outfile :
422
+ with open (file_a , "w" , encoding = " utf-8" ) as outfile :
423
423
outfile .write ("hello world\n " )
424
424
repo .git .add (Git .polish_url (file_a ))
425
425
repo .git .commit (message = "Added file_a.txt" )
@@ -429,21 +429,21 @@ def test_rename_override(self, rw_dir):
429
429
430
430
# create and commit file_b.txt with similarity index of 52
431
431
file_b = osp .join (rw_dir , "file_b.txt" )
432
- with open (file_b , "w" , encoding = ' utf-8' ) as outfile :
432
+ with open (file_b , "w" , encoding = " utf-8" ) as outfile :
433
433
outfile .write ("hello world\n hello world" )
434
434
repo .git .add (Git .polish_url (file_b ))
435
435
repo .git .commit (message = "Removed file_a.txt. Added file_b.txt" )
436
436
437
- commit_a = repo .commit (' HEAD' )
438
- commit_b = repo .commit (' HEAD~1' )
437
+ commit_a = repo .commit (" HEAD" )
438
+ commit_b = repo .commit (" HEAD~1" )
439
439
440
440
# check default diff command with renamed files enabled
441
441
diffs = commit_b .diff (commit_a )
442
442
self .assertEqual (1 , len (diffs ))
443
443
diff = diffs [0 ]
444
444
self .assertEqual (True , diff .renamed_file )
445
- self .assertEqual (' file_a.txt' , diff .rename_from )
446
- self .assertEqual (' file_b.txt' , diff .rename_to )
445
+ self .assertEqual (" file_a.txt" , diff .rename_from )
446
+ self .assertEqual (" file_b.txt" , diff .rename_to )
447
447
448
448
# check diff with rename files disabled
449
449
diffs = commit_b .diff (commit_a , no_renames = True )
@@ -452,31 +452,31 @@ def test_rename_override(self, rw_dir):
452
452
# check fileA.txt deleted
453
453
diff = diffs [0 ]
454
454
self .assertEqual (True , diff .deleted_file )
455
- self .assertEqual (' file_a.txt' , diff .a_path )
455
+ self .assertEqual (" file_a.txt" , diff .a_path )
456
456
457
457
# check fileB.txt added
458
458
diff = diffs [1 ]
459
459
self .assertEqual (True , diff .new_file )
460
- self .assertEqual (' file_b.txt' , diff .a_path )
460
+ self .assertEqual (" file_b.txt" , diff .a_path )
461
461
462
462
# check diff with high similarity index
463
- diffs = commit_b .diff (commit_a , split_single_char_options = False , M = ' 75%' )
463
+ diffs = commit_b .diff (commit_a , split_single_char_options = False , M = " 75%" )
464
464
self .assertEqual (2 , len (diffs ))
465
465
466
466
# check fileA.txt deleted
467
467
diff = diffs [0 ]
468
468
self .assertEqual (True , diff .deleted_file )
469
- self .assertEqual (' file_a.txt' , diff .a_path )
469
+ self .assertEqual (" file_a.txt" , diff .a_path )
470
470
471
471
# check fileB.txt added
472
472
diff = diffs [1 ]
473
473
self .assertEqual (True , diff .new_file )
474
- self .assertEqual (' file_b.txt' , diff .a_path )
474
+ self .assertEqual (" file_b.txt" , diff .a_path )
475
475
476
476
# check diff with low similarity index
477
- diffs = commit_b .diff (commit_a , split_single_char_options = False , M = ' 40%' )
477
+ diffs = commit_b .diff (commit_a , split_single_char_options = False , M = " 40%" )
478
478
self .assertEqual (1 , len (diffs ))
479
479
diff = diffs [0 ]
480
480
self .assertEqual (True , diff .renamed_file )
481
- self .assertEqual (' file_a.txt' , diff .rename_from )
482
- self .assertEqual (' file_b.txt' , diff .rename_to )
481
+ self .assertEqual (" file_a.txt" , diff .rename_from )
482
+ self .assertEqual (" file_b.txt" , diff .rename_to )
0 commit comments