@@ -414,6 +414,16 @@ def test_index(self):
414414 def test_tag (self ):
415415 assert self .rorepo .tag ('refs/tags/0.1.5' ).commit
416416
417+ def test_tag_to_full_tag_path (self ):
418+ tags = ['0.1.5' , 'tags/0.1.5' , 'refs/tags/0.1.5' ]
419+ value_errors = []
420+ for tag in tags :
421+ try :
422+ self .rorepo .tag (tag )
423+ except ValueError as valueError :
424+ value_errors .append (valueError .args [0 ])
425+ raise ValueError ('. ' .join (value_errors ))
426+
417427 def test_archive (self ):
418428 tmpfile = tempfile .mktemp (suffix = 'archive-test' )
419429 with open (tmpfile , 'wb' ) as stream :
@@ -445,7 +455,7 @@ def test_should_display_blame_information(self, git):
445455 tlist = b [0 ][1 ]
446456 self .assertTrue (tlist )
447457 self .assertTrue (isinstance (tlist [0 ], str ))
448- self .assertTrue (len (tlist ) < sum (len (t ) for t in tlist )) # test for single-char bug
458+ self .assertTrue (len (tlist ) < sum (len (t ) for t in tlist )) # test for single-char bug
449459
450460 # BINARY BLAME
451461 git .return_value = fixture ('blame_binary' )
@@ -454,7 +464,7 @@ def test_should_display_blame_information(self, git):
454464
455465 def test_blame_real (self ):
456466 c = 0
457- nml = 0 # amount of multi-lines per blame
467+ nml = 0 # amount of multi-lines per blame
458468 for item in self .rorepo .head .commit .tree .traverse (
459469 predicate = lambda i , d : i .type == 'blob' and i .path .endswith ('.py' )):
460470 c += 1
@@ -486,7 +496,8 @@ def test_blame_incremental(self, git):
486496
487497 # Original line numbers
488498 orig_ranges = flatten ([entry .orig_linenos for entry in blame_output ])
489- self .assertEqual (orig_ranges , flatten ([range (2 , 3 ), range (14 , 15 ), range (1 , 2 ), range (2 , 13 ), range (13 , 15 )])) # noqa E501
499+ self .assertEqual (orig_ranges , flatten (
500+ [range (2 , 3 ), range (14 , 15 ), range (1 , 2 ), range (2 , 13 ), range (13 , 15 )])) # noqa E501
490501
491502 @mock .patch .object (Git , '_call_process' )
492503 def test_blame_complex_revision (self , git ):
@@ -530,9 +541,9 @@ def test_untracked_files(self, rwrepo):
530541 # end for each run
531542
532543 def test_config_reader (self ):
533- reader = self .rorepo .config_reader () # all config files
544+ reader = self .rorepo .config_reader () # all config files
534545 assert reader .read_only
535- reader = self .rorepo .config_reader ("repository" ) # single config file
546+ reader = self .rorepo .config_reader ("repository" ) # single config file
536547 assert reader .read_only
537548
538549 def test_config_writer (self ):
@@ -729,7 +740,7 @@ def _assert_rev_parse(self, name):
729740 def test_rw_rev_parse (self , rwrepo ):
730741 # verify it does not confuse branches with hexsha ids
731742 ahead = rwrepo .create_head ('aaaaaaaa' )
732- assert (rwrepo .rev_parse (str (ahead )) == ahead .commit )
743+ assert (rwrepo .rev_parse (str (ahead )) == ahead .commit )
733744
734745 def test_rev_parse (self ):
735746 rev_parse = self .rorepo .rev_parse
@@ -1041,7 +1052,7 @@ def test_git_work_tree_env(self, rw_dir):
10411052 def test_rebasing (self , rw_dir ):
10421053 r = Repo .init (rw_dir )
10431054 fp = osp .join (rw_dir , 'hello.txt' )
1044- r .git .commit ("--allow-empty" , message = "init" ,)
1055+ r .git .commit ("--allow-empty" , message = "init" , )
10451056 with open (fp , 'w' ) as fs :
10461057 fs .write ("hello world" )
10471058 r .git .add (Git .polish_url (fp ))
0 commit comments