def test_with_remote_defined_in_user_conf(self): self.releaser_config.remove_option("test", "remote_location") user_config = {'COPR_REMOTE_LOCATION': 'http://example.com/~otheruser/'} releaser = CoprReleaser(PKG_NAME, None, '/tmp/tito/', self.config, user_config, 'test', self.releaser_config, False, False, False, **{'offline': True}) releaser.release(dry_run=True) self.assertTrue(releaser.srpm_submitted is not None)
def test_no_remote_defined(self, upload, submit): self.releaser_config.remove_option("test", "remote_location") releaser = CoprReleaser(PKG_NAME, None, '/tmp/tito/', self.config, {}, 'test', self.releaser_config, False, False, False, **{'offline': True}) releaser.release(dry_run=True) self.assertFalse(upload.called) self.assertTrue(submit.called)
def test_multiple_project_names(self, run_command): self.releaser_config.remove_option("test", "remote_location") self.releaser_config.set('test', 'project_name', "%s %s" % (PKG_NAME, PKG_NAME)) releaser = CoprReleaser(PKG_NAME, None, '/tmp/tito/', self.config, {}, 'test', self.releaser_config, False, False, False, **{'offline': True}) releaser.release() args = mock.call('/usr/bin/copr-cli build --nowait releaseme %s' % releaser.builder.srpm_location) self.assertEquals(args, run_command.mock_calls[0]) self.assertEquals(args, run_command.mock_calls[1])
def test_with_releaser(self): releaser = CoprReleaser( PKG_NAME, None, "/tmp/tito/", self.config, {}, "test", self.releaser_config, False, False, False, **{"offline": True} ) releaser.release(dry_run=True) self.assertTrue(releaser.srpm_submitted is not None)
def test_multiple_project_names(self, run_command): self.releaser_config.remove_option("test", "remote_location") self.releaser_config.set("test", "project_name", "%s %s" % (PKG_NAME, PKG_NAME)) releaser = CoprReleaser( PKG_NAME, None, "/tmp/tito/", self.config, {}, "test", self.releaser_config, False, False, False, **{"offline": True} ) releaser.release() args = mock.call("/usr/bin/copr-cli build --nowait releaseme %s" % releaser.builder.srpm_location) self.assertEquals(args, run_command.mock_calls[0]) self.assertEquals(args, run_command.mock_calls[1])
def test_with_releaser(self): releaser = CoprReleaser(PKG_NAME, None, '/tmp/tito/', self.config, {}, 'test', self.releaser_config, False, False, False, **{'offline': True}) releaser.release(dry_run=True) self.assertTrue(releaser.srpm_submitted is not None)