mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 14:30:30 +03:00 
			
		
		
		
	Merge branch 'test_getref' into 'master'
Add test for git getref Closes #1040 See merge request fdroid/fdroidserver!1191
This commit is contained in:
		
						commit
						2b5ac31bf8
					
				
					 1 changed files with 17 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -2382,6 +2382,23 @@ class CommonTest(unittest.TestCase):
 | 
			
		|||
            vcs = fdroidserver.common.vcs_git(None, Path.cwd())
 | 
			
		||||
            self.assertEqual(vcs.latesttags(), tags[::-1])
 | 
			
		||||
 | 
			
		||||
    def test_vcs_git_getref(self):
 | 
			
		||||
 | 
			
		||||
        with tempfile.TemporaryDirectory() as tmpdir, TmpCwd(tmpdir):
 | 
			
		||||
            # TODO: Python3.6: Should accept path-like
 | 
			
		||||
            repo = git.Repo.init(str(Path.cwd()))
 | 
			
		||||
            tag = "1.1.1"
 | 
			
		||||
            f = Path("test")
 | 
			
		||||
            f.write_text(tag)
 | 
			
		||||
            repo.index.add([str(f)])
 | 
			
		||||
            repo.index.commit("foo")
 | 
			
		||||
            repo.create_tag(tag)
 | 
			
		||||
 | 
			
		||||
            vcs = fdroidserver.common.vcs_git(None, Path.cwd())
 | 
			
		||||
 | 
			
		||||
            self.assertIsNotNone(vcs.getref("1.1.1"))
 | 
			
		||||
            self.assertIsNone(vcs.getref("invalid"))
 | 
			
		||||
 | 
			
		||||
    def test_get_release_filename(self):
 | 
			
		||||
        app = fdroidserver.metadata.App()
 | 
			
		||||
        app.id = 'test.app'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue