def test_transaction_download(self): pkg = mock.MagicMock() repo = mock.MagicMock() repo.id = 'test' pkg.name = "kernel" pkg.repo = repo self.cli.base.transaction.install_set = [pkg] self.command.opts = mock.MagicMock() self.command.opts.distro_sync = "distro_sync" self.command.opts.repos_ed = [] self.cli.demands.allow_erasing = "allow_erasing" self.command.base.conf.best = "best" self.command.base.conf.installroot = "/" self.command.base.conf.releasever = "35" self.command.base.conf.gpgcheck = True self.command.base.conf.destdir = "/grape/wine" self.command.base.conf.install_weak_deps = True self.command.base.conf.module_platform_id = '' self.command.transaction_download() with system_upgrade.State() as state: self.assertEqual(state.download_status, "complete") self.assertEqual(state.distro_sync, "distro_sync") self.assertEqual(state.allow_erasing, "allow_erasing") self.assertEqual(state.best, "best") self.assertEqual(state.destdir, "/grape/wine")
def test_transaction_download_offline_upgrade(self): pkg = mock.MagicMock() repo = mock.MagicMock() repo.id = 'test' pkg.name = "kernel" pkg.repo = repo self.cli.base.transaction.install_set = [pkg] self.command.opts = mock.MagicMock() self.command.opts.distro_sync = True self.command.opts.command = "offline-upgrade" self.command.opts.repos_ed = [] self.cli.demands.allow_erasing = "allow_erasing" self.command.base.conf.best = True self.command.base.conf.releasever = "35" self.command.base.conf.gpgcheck = True self.command.opts.destdir = self.datadir self.command.base.conf.install_weak_deps = True self.command.base.conf.module_platform_id = '' self.command.pre_configure_download() self.command.transaction_download() with system_upgrade.State(self.command.state.statefile) as state: self.assertEqual(state.download_status, "complete") self.assertEqual(state.distro_sync, False) self.assertEqual(state.destdir, self.datadir) self.assertEqual(state.upgrade_command, "offline-upgrade")
def test_transaction_download(self): self.command.opts = mock.MagicMock() self.command.opts.needkernel = False self.command.opts.distro_sync = "distro_sync" self.cli.demands.allow_erasing = "allow_erasing" self.command.base.conf.best = "best" self.command.base.conf.installroot = "/" self.command.base.conf.releasever = "35" self.command.transaction_download() with system_upgrade.State() as state: self.assertEqual(state.download_status, "complete") self.assertEqual(state.distro_sync, "distro_sync") self.assertEqual(state.allow_erasing, "allow_erasing") self.assertEqual(state.best, "best")