コード例 #1
0
 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)
コード例 #2
0
 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)
コード例 #3
0
 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')
コード例 #4
0
 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]
コード例 #5
0
ファイル: test_check.py プロジェクト: yurchor/dnf
 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)
コード例 #6
0
 def setUp(self):
     self.cmd = repograph.RepoGraphCommand(
         support.CliStub(support.BaseStub()))
     self.path = os.path.join(os.path.dirname(__file__),
                              "resources/repograph/")
コード例 #7
0
 def setUp(self):
     self.cmd = dnf.cli.commands.repoquery.RepoQueryCommand(
         support.CliStub(support.BaseCliStub()))
コード例 #8
0
 def setUp(self):
     self.cmd = builddep.BuildDepCommand(support.CliStub(None))
コード例 #9
0
 def setUp(self):
     self.cmd = repoclosure.RepoClosureCommand(
         support.CliStub(support.BaseStub()))
     self.path = os.path.join(os.path.dirname(__file__),
                              "resources/repoclosure/")
コード例 #10
0
 def setUp(self):
     cli = support.CliStub(support.BaseCliStub())
     self.cmd = reposync.RepoSyncCommand(cli)