File: test_dnf_db_group.py

package info (click to toggle)
dnf 4.5.2-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 10,556 kB
  • sloc: python: 26,916; xml: 778; sh: 131; makefile: 42
file content (37 lines) | stat: -rw-r--r-- 1,009 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
# -*- coding: utf-8 -*-


from __future__ import absolute_import
from __future__ import unicode_literals

import dnf

from .common import TestCase


class DnfRPMTransactionApiTest(TestCase):
    def setUp(self):
        self.base = dnf.Base(dnf.conf.Conf())
        self.base.conf.persistdir = "/tmp/tests"
        self.base.fill_sack(False, False)
        self.base.resolve()
        self.rpmTrans = self.base.transaction

    def tearDown(self):
        self.base.close()

    def test_iterator(self):
        # RPMTransaction.__iter__
        self.assertHasAttr(self.rpmTrans, "__iter__")
        for i in self.rpmTrans:
            pass

    def test_install_set(self):
        # RPMTransaction.install_set
        self.assertHasAttr(self.rpmTrans, "install_set")
        self.assertHasType(self.rpmTrans.install_set, set)

    def test_remove_set(self):
        # RPMTransaction.remove_set
        self.assertHasAttr(self.rpmTrans, "remove_set")
        self.assertHasType(self.rpmTrans.remove_set, set)