Files
update/cgcs-patch/cgcs-patch/cgcs_patch/tests/test_patch_agent.py
Don Penney 44cdc55fd8 Migrate patch-agent to use DNF for swmgmt
As the smart package manager is not supported under python3, we're
migrating the patch-agent to use the python2 DNF libraries in
preparation for CentOS 8. This impacts how the patch-agent queries the
repos and manages installed software, but is done without changing how
the patch-agent and patch-controller exchange information, to ensure
we don't impact cross-version communication in an upgrade scenario.

Depends-On: https://review.opendev.org/700960
Change-Id: I00729a487c24ba5c182a9a2a48e2024be9260978
Story: 2006227
Task: 37932
Signed-off-by: Don Penney <don.penney@windriver.com>
2020-01-13 09:20:06 -05:00

31 lines
823 B
Python

#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (c) 2019 Wind River Systems, Inc.
#
import mock
import six # pylint: disable=unused-import
import sys
import testtools
sys.modules['rpm'] = mock.Mock()
sys.modules['dnf'] = mock.Mock()
sys.modules['dnf.callback'] = mock.Mock()
sys.modules['dnf.comps'] = mock.Mock()
sys.modules['dnf.exceptions'] = mock.Mock()
sys.modules['dnf.rpm'] = mock.Mock()
sys.modules['dnf.sack'] = mock.Mock()
sys.modules['dnf.transaction'] = mock.Mock()
sys.modules['libdnf'] = mock.Mock()
sys.modules['libdnf.transaction'] = mock.Mock()
import cgcs_patch.patch_agent # noqa: E402
class CgcsPatchAgentTestCase(testtools.TestCase):
def test_cgcs_patch_agent_instantiate(self):
# pylint: disable=unused-variable
pc = cgcs_patch.patch_agent.PatchAgent() # noqa: F841