def test_info(self): self.cmd = dnf.cli.commands.repoquery.RepoQueryCommand( support.CliStub(support.BaseCliStub())) support.command_configure(self.cmd, ['--source']) pkg = dnf.cli.commands.repoquery.PackageWrapper(PkgStub()) self.assertEqual(self.cmd.build_format_fn(self.cmd.opts, pkg), EXPECTED_SOURCERPM_FORMAT)
def test_filelist(self): self.cmd = dnf.cli.commands.repoquery.RepoQueryCommand( support.CliStub(support.BaseCliStub())) support.command_configure(self.cmd, ['-l']) pkg = dnf.cli.commands.repoquery.PackageWrapper(PkgStub()) self.assertEqual(self.cmd.build_format_fn(self.cmd.opts, pkg), EXPECTED_FILELIST_FORMAT)
def test_parse_args(self): cli = support.CliStub(support.BaseCliStub()) cli.base.repos.add(dnf.repo.Repo(name='silver')) cli.base.repos.add(dnf.repo.Repo(name='screen')) cmd = reposync.RepoSyncCommand(cli) args = '-p /become/legend --repo=silver --repo=screen'.split() support.command_configure(cmd, args) self.assertEqual(cmd.opts.repo, ['silver', 'screen']) self.assertEqual(cmd.opts.download_path, '/become/legend')
def setUp(self): """Prepare the test fixture.""" super(_KickstartCommandFixture, self).setUp() base = support.BaseCliStub(self.AVAILABLE_PACKAGES, self.AVAILABLE_GROUPS) cli = support.CliStub(base) self._command = kickstart.KickstartCommand(cli) cli.register_command(self._command) base.read_all_repos() base.basecmd = self._command.aliases[0]
def test_obsoleted(self): self.cmd = dnf.cli.commands.check.CheckCommand( support.CliStub(support.BaseCliStub())) support.command_configure(self.cmd, ['--obsoleted']) with support.patch_std_streams() as (stdout, _): with self.assertRaises(dnf.exceptions.Error) as ctx: self.cmd.run() self.assertEqual(str(ctx.exception), 'Check discovered 1 problem(s)') self.assertEqual(stdout.getvalue(), EXPECTED_OBSOLETED_FORMAT)
def setUp(self): self.cmd = repograph.RepoGraphCommand( support.CliStub(support.BaseStub())) self.path = os.path.join(os.path.dirname(__file__), "resources/repograph/")
def setUp(self): self.cmd = dnf.cli.commands.repoquery.RepoQueryCommand( support.CliStub(support.BaseCliStub()))
def setUp(self): self.cmd = builddep.BuildDepCommand(support.CliStub(None))
def setUp(self): self.cmd = repoclosure.RepoClosureCommand( support.CliStub(support.BaseStub())) self.path = os.path.join(os.path.dirname(__file__), "resources/repoclosure/")
def setUp(self): cli = support.CliStub(support.BaseCliStub()) self.cmd = reposync.RepoSyncCommand(cli)