File: test_dnf_cli_commands.py

package info (click to toggle)
dnf 4.24.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,820 kB
  • sloc: python: 27,723; xml: 771; sh: 131; makefile: 35
file content (62 lines) | stat: -rw-r--r-- 1,890 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# -*- coding: utf-8 -*-


from __future__ import absolute_import
from __future__ import unicode_literals

import dnf
import dnf.cli.commands

from .common import TestCase


class DnfCliCommandsApiTest(TestCase):
    def setUp(self):
        base = dnf.Base(dnf.conf.Conf())
        cli = dnf.cli.cli.Cli(base=base)
        self.command = dnf.cli.commands.Command(cli=cli)

    def test_command(self):
        # dnf.cli.commands.Command
        self.assertHasAttr(dnf.cli.commands, "Command")
        self.assertHasType(dnf.cli.commands.Command, object)

    def test_init(self):
        base = dnf.Base(dnf.conf.Conf())
        cli = dnf.cli.cli.Cli(base=base)
        _ = dnf.cli.commands.Command(cli=cli)

    def test_aliases(self):
        # dnf.cli.commands.Command.aliases
        self.assertHasAttr(self.command, "aliases")
        self.assertHasType(self.command.aliases, list)

    def test_summary(self):
        # dnf.cli.commands.Command.summary
        self.assertHasAttr(self.command, "summary")
        self.assertHasType(self.command.summary, str)

    def test_base(self):
        # dnf.cli.commands.Command.base
        self.assertHasAttr(self.command, "base")
        self.assertHasType(self.command.base, dnf.Base)

    def test_cli(self):
        # dnf.cli.commands.Command.cli
        self.assertHasAttr(self.command, "cli")
        self.assertHasType(self.command.cli, dnf.cli.cli.Cli)

    def test_pre_configure(self):
        # dnf.cli.commands.Command.pre_configure
        self.assertHasAttr(self.command, "pre_configure")
        self.command.pre_configure()

    def test_configure(self):
        # dnf.cli.commands.Command.configure
        self.assertHasAttr(self.command, "configure")
        self.command.configure()

    def test_run(self):
        # dnf.cli.commands.Command.run
        self.assertHasAttr(self.command, "run")
        self.command.run()