mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 14:32:28 +03:00
nightly: set up test for git clone function
This commit is contained in:
parent
d398994ad3
commit
ce018158ee
2 changed files with 33 additions and 6 deletions
|
@ -192,6 +192,29 @@ class NightlyTest(unittest.TestCase):
|
|||
with self.assertRaises(exception.VCSException):
|
||||
nightly.main()
|
||||
|
||||
def test_clone_git_repo(self):
|
||||
os.chdir(self.testdir)
|
||||
common.options = Options
|
||||
d = 'fakeappid'
|
||||
nightly.clone_git_repo('https://gitlab.com/fdroid/ci-test-tiny-repo.git', d)
|
||||
self.assertTrue(os.path.isdir(Path(d) / '.git'))
|
||||
|
||||
def test_clone_git_repo_fails_on_gitlab_password_prompt(self):
|
||||
os.chdir(self.testdir)
|
||||
common.options = Options
|
||||
d = 'shouldnotbecreated'
|
||||
with self.assertRaises(exception.VCSException):
|
||||
nightly.clone_git_repo(f'https://gitlab.com/{d}/{d}.git', d)
|
||||
self.assertFalse(os.path.isdir(Path(d)))
|
||||
|
||||
def test_clone_git_repo_fails_on_github_password_prompt(self):
|
||||
os.chdir(self.testdir)
|
||||
common.options = Options
|
||||
d = 'shouldnotbecreated'
|
||||
with self.assertRaises(exception.VCSException):
|
||||
nightly.clone_git_repo(f'https://github.com/{d}/{d}.git', d)
|
||||
self.assertFalse(os.path.isdir(Path(d)))
|
||||
|
||||
def _put_fdroid_in_args(self, args):
|
||||
"""Find fdroid command that belongs to this source code tree"""
|
||||
fdroid = os.path.join(basedir.parent, 'fdroid')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue