From 5e5269969c6af00790ec91ed13e3c78aee91d3d2 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Jun 27 2017 16:58:15 +0000 Subject: another test --- diff --git a/tests/test_scm.py b/tests/test_scm.py index a91f129..1655e73 100644 --- a/tests/test_scm.py +++ b/tests/test_scm.py @@ -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])