another test

This commit is contained in:
Mike McLean 2017-05-11 22:19:05 -04:00
parent 49b4d0ae9f
commit c49d8552b8

View file

@ -247,3 +247,28 @@ class TestSCMCheckouts(unittest.TestCase):
self.uploadpath, cwd=self.tempdir + '/koji',
logerror=1, append=True, env=None)
self.log_output.assert_has_calls([call1, call2])
def test_checkout_git_common(self):
url = "git://default/koji.git#asdasd"
scm = SCM(url)
scm.assert_allowed(self.allowed)
scm.checkout(self.tempdir, session=self.session,
uploadpath=self.uploadpath, logfile=self.logfile)
self.assertEqual(scm.use_common, True)
self.symlink.assert_called_once()
# expected commands
cmd = ['git', 'clone', '-n', 'git://default/koji.git',
self.tempdir + '/koji']
call1 = mock.call(self.session, cmd[0], cmd, self.logfile,
self.uploadpath, cwd=self.tempdir, logerror=1,
append=False, env=None)
cmd = ['git', 'reset', '--hard', 'asdasd']
call2 = mock.call(self.session, cmd[0], cmd, self.logfile,
self.uploadpath, cwd=self.tempdir + '/koji',
logerror=1, append=True, env=None)
cmd = ['git', 'clone', 'git://default/common.git', 'common']
call3 = mock.call(self.session, cmd[0], cmd, self.logfile,
self.uploadpath, cwd=self.tempdir,
logerror=1, append=True, env=None)
self.log_output.assert_has_calls([call1, call2, call3])