Blame tests/api/test_dnf_callback.py

Packit Service 21c75c
# -*- coding: utf-8 -*-
Packit Service 21c75c
Packit Service 21c75c
Packit Service 21c75c
from __future__ import absolute_import
Packit Service 21c75c
from __future__ import unicode_literals
Packit Service 21c75c
Packit Service 21c75c
import dnf
Packit Service 21c75c
Packit Service 21c75c
from .common import TestCase
Packit Service 21c75c
Packit Service 21c75c
Packit Service 21c75c
class DnfCallbackApiTest(TestCase):
Packit Service 21c75c
    def test_pkg_downgrade(self):
Packit Service 21c75c
        # dnf.callback.PKG_DOWNGRADE
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "PKG_DOWNGRADE")
Packit Service 21c75c
        self.assertHasType(dnf.callback.PKG_DOWNGRADE, int)
Packit Service 21c75c
Packit Service 21c75c
    def test_downgraded(self):
Packit Service 21c75c
        # dnf.callback.PKG_DOWNGRADED
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "PKG_DOWNGRADED")
Packit Service 21c75c
        self.assertHasType(dnf.callback.PKG_DOWNGRADED, int)
Packit Service 21c75c
Packit Service 21c75c
    def test_pkg_install(self):
Packit Service 21c75c
        # dnf.callback.PKG_INSTALL
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "PKG_INSTALL")
Packit Service 21c75c
        self.assertHasType(dnf.callback.PKG_INSTALL, int)
Packit Service 21c75c
Packit Service 21c75c
    def test_pkg_obsolete(self):
Packit Service 21c75c
        # dnf.callback.PKG_OBSOLETE
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "PKG_OBSOLETE")
Packit Service 21c75c
        self.assertHasType(dnf.callback.PKG_OBSOLETE, int)
Packit Service 21c75c
Packit Service 21c75c
    def test_pkg_obsoleted(self):
Packit Service 21c75c
        # dnf.callback.PKG_OBSOLETED
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "PKG_OBSOLETED")
Packit Service 21c75c
        self.assertHasType(dnf.callback.PKG_OBSOLETED, int)
Packit Service 21c75c
Packit Service 21c75c
    def test_pkg_reinstall(self):
Packit Service 21c75c
        # dnf.callback.PKG_REINSTALL
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "PKG_REINSTALL")
Packit Service 21c75c
        self.assertHasType(dnf.callback.PKG_REINSTALL, int)
Packit Service 21c75c
Packit Service 21c75c
    def test_pkg_reinstalled(self):
Packit Service 21c75c
        # dnf.callback.PKG_REINSTALLED
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "PKG_REINSTALLED")
Packit Service 21c75c
        self.assertHasType(dnf.callback.PKG_REINSTALLED, int)
Packit Service 21c75c
Packit Service 21c75c
    def test_pkg_remove(self):
Packit Service 21c75c
        # dnf.callback.PKG_REMOVE
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "PKG_REMOVE")
Packit Service 21c75c
        self.assertHasType(dnf.callback.PKG_REMOVE, int)
Packit Service 21c75c
Packit Service 21c75c
    def test_pkg_upgrade(self):
Packit Service 21c75c
        # dnf.callback.PKG_UPGRADE
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "PKG_UPGRADE")
Packit Service 21c75c
        self.assertHasType(dnf.callback.PKG_UPGRADE, int)
Packit Service 21c75c
Packit Service 21c75c
    def test_pkg_upgraded(self):
Packit Service 21c75c
        # dnf.callback.PKG_UPGRADED
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "PKG_UPGRADED")
Packit Service 21c75c
        self.assertHasType(dnf.callback.PKG_UPGRADED, int)
Packit Service 21c75c
Packit Service 21c75c
    def test_pkg_cleanup(self):
Packit Service 21c75c
        # dnf.callback.PKG_CLEANUP
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "PKG_CLEANUP")
Packit Service 21c75c
        self.assertHasType(dnf.callback.PKG_CLEANUP, int)
Packit Service 21c75c
Packit Service 21c75c
    def test_pkg_verify(self):
Packit Service 21c75c
        # dnf.callback.PKG_VERIFY
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "PKG_VERIFY")
Packit Service 21c75c
        self.assertHasType(dnf.callback.PKG_VERIFY, int)
Packit Service 21c75c
Packit Service 21c75c
    def test_pkg_scriptlet(self):
Packit Service 21c75c
        # dnf.callback.PKG_SCRIPTLET
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "PKG_SCRIPTLET")
Packit Service 21c75c
        self.assertHasType(dnf.callback.PKG_SCRIPTLET, int)
Packit Service 21c75c
Packit Service 21c75c
    def test_trans_preparation(self):
Packit Service 21c75c
        # dnf.callback.TRANS_PREPARATION
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "TRANS_PREPARATION")
Packit Service 21c75c
        self.assertHasType(dnf.callback.TRANS_PREPARATION, int)
Packit Service 21c75c
Packit Service 21c75c
    def test_trans_post(self):
Packit Service 21c75c
        # dnf.callback.TRANS_POST
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "TRANS_POST")
Packit Service 21c75c
        self.assertHasType(dnf.callback.TRANS_POST, int)
Packit Service 21c75c
Packit Service 21c75c
    def test_status_ok(self):
Packit Service 21c75c
        # dnf.callback.STATUS_OK
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "STATUS_OK")
Packit Service 21c75c
        self.assertHasType(dnf.callback.STATUS_OK, object)
Packit Service 21c75c
Packit Service 21c75c
    def test_status_failed(self):
Packit Service 21c75c
        # dnf.callback.STATUS_FAILED
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "STATUS_FAILED")
Packit Service 21c75c
        self.assertHasType(dnf.callback.STATUS_FAILED, int)
Packit Service 21c75c
Packit Service 21c75c
    def test_status_already_exists(self):
Packit Service 21c75c
        # dnf.callback.STATUS_ALREADY_EXISTS
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "STATUS_ALREADY_EXISTS")
Packit Service 21c75c
        self.assertHasType(dnf.callback.STATUS_ALREADY_EXISTS, int)
Packit Service 21c75c
Packit Service 21c75c
    def test_status_mirror(self):
Packit Service 21c75c
        # dnf.callback.STATUS_MIRROR
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "STATUS_MIRROR")
Packit Service 21c75c
        self.assertHasType(dnf.callback.STATUS_MIRROR, int)
Packit Service 21c75c
Packit Service 21c75c
    def test_status_drpm(self):
Packit Service 21c75c
        # dnf.callback.STATUS_DRPM
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "STATUS_DRPM")
Packit Service 21c75c
        self.assertHasType(dnf.callback.STATUS_DRPM, int)
Packit Service 21c75c
Packit Service 21c75c
    def test_payload(self):
Packit Service 21c75c
        # dnf.callback.Payload
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "Payload")
Packit Service 21c75c
        self.assertHasType(dnf.callback.Payload, object)
Packit Service 21c75c
Packit Service 21c75c
    def test_payload_init(self):
Packit Service 21c75c
        # dnf.callback.Payload.__init__
Packit Service 21c75c
        download_progress = dnf.callback.DownloadProgress()
Packit Service 21c75c
        _ = dnf.callback.Payload(progress=download_progress)
Packit Service 21c75c
Packit Service 21c75c
    def test_payload_str(self):
Packit Service 21c75c
        # dnf.callback.Payload.__str__
Packit Service 21c75c
        download_progress = dnf.callback.DownloadProgress()
Packit Service 21c75c
        payload = dnf.callback.Payload(progress=download_progress)
Packit Service 21c75c
        payload.__str__()
Packit Service 21c75c
Packit Service 21c75c
    def test_payload_download_size(self):
Packit Service 21c75c
        # dnf.callback.Payload.download_size
Packit Service 21c75c
        download_progress = dnf.callback.DownloadProgress()
Packit Service 21c75c
        payload = dnf.callback.Payload(progress=download_progress)
Packit Service 21c75c
        self.assertHasAttr(payload, "download_size")
Packit Service 21c75c
        self.assertHasType(payload.download_size, object)
Packit Service 21c75c
Packit Service 21c75c
    def test_download_progress(self):
Packit Service 21c75c
        # dnf.callback.DownloadProgress
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "DownloadProgress")
Packit Service 21c75c
        self.assertHasType(dnf.callback.DownloadProgress, object)
Packit Service 21c75c
Packit Service 21c75c
    def test_download_progress_end(self):
Packit Service 21c75c
        # dnf.callback.DownloadProgress.end
Packit Service 21c75c
        download_progress = dnf.callback.DownloadProgress()
Packit Service 21c75c
        payload = dnf.callback.Payload(progress=download_progress)
Packit Service 21c75c
        download_progress.end(payload=payload, status=dnf.callback.STATUS_OK, msg="err_msg")
Packit Service 21c75c
Packit Service 21c75c
    def test_download_progress_progress(self):
Packit Service 21c75c
        # dnf.callback.DownloadProgress.progress
Packit Service 21c75c
        download_progress = dnf.callback.DownloadProgress()
Packit Service 21c75c
        payload = dnf.callback.Payload(progress=download_progress)
Packit Service 21c75c
        download_progress.progress(payload=payload, done=0)
Packit Service 21c75c
Packit Service 21c75c
    def test_download_progress_start(self):
Packit Service 21c75c
        # dnf.callback.DownloadProgress.start
Packit Service 21c75c
        download_progress = dnf.callback.DownloadProgress()
Packit Service 21c75c
        download_progress.start(total_files=1, total_size=1, total_drpms=0)
Packit Service 21c75c
Packit Service 21c75c
    def test_TransactionProgress(self):
Packit Service 21c75c
        # dnf.callback.TransactionProgress
Packit Service 21c75c
        self.assertHasAttr(dnf.callback, "TransactionProgress")
Packit Service 21c75c
        self.assertHasType(dnf.callback.TransactionProgress, object)