mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-07 04:38:09 +08:00
Merge #1200 Fix the unit tests
This commit is contained in:
1
Vagrantfile
vendored
1
Vagrantfile
vendored
@@ -20,6 +20,7 @@ $script = <<SCRIPT
|
||||
openssl-devel \
|
||||
python \
|
||||
python-devel \
|
||||
python2-dnf \
|
||||
python-docutils \
|
||||
python-flask \
|
||||
python-gobject-base \
|
||||
|
||||
@@ -20,6 +20,7 @@ RUN yum -y install \
|
||||
kobo-rpmlib \
|
||||
libmodulemd \
|
||||
python-backports-ssl_match_hostname \
|
||||
python-dnf \
|
||||
python-dogpile-cache \
|
||||
python-enum34 \
|
||||
python-flask \
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
FROM fedora:29
|
||||
|
||||
WORKDIR /build
|
||||
# Pin the version of libsolv until the following is in stable:
|
||||
# https://bodhi.fedoraproject.org/updates/FEDORA-2019-c381c7bf54
|
||||
RUN dnf -y install \
|
||||
--nogpgcheck \
|
||||
--setopt=deltarpm=0 \
|
||||
@@ -13,6 +15,7 @@ RUN dnf -y install \
|
||||
python3-rpm \
|
||||
libmodulemd \
|
||||
python3-gobject \
|
||||
python3-dnf \
|
||||
python3-dogpile-cache \
|
||||
python3-flask \
|
||||
python3-flask-migrate \
|
||||
@@ -24,7 +27,8 @@ RUN dnf -y install \
|
||||
python3-prometheus_client \
|
||||
python3-requests \
|
||||
python3-six \
|
||||
python3-solv \
|
||||
https://kojipkgs.fedoraproject.org//packages/libsolv/0.7.4/2.fc29/x86_64/libsolv-0.7.4-2.fc29.x86_64.rpm \
|
||||
https://kojipkgs.fedoraproject.org//packages/libsolv/0.7.4/2.fc29/x86_64/python3-solv-0.7.4-2.fc29.x86_64.rpm \
|
||||
python3-sqlalchemy \
|
||||
python3-pungi \
|
||||
# Test-only dependencies
|
||||
|
||||
@@ -1254,10 +1254,8 @@ class TestOfflineLocalBuilds:
|
||||
profiles = mmd.get_profiles()
|
||||
assert set(profiles.keys()) == set(["buildroot", "srpm-buildroot"])
|
||||
|
||||
@patch("module_build_service.utils.general.open", create=True)
|
||||
@patch("module_build_service.utils.general.open", create=True, new_callable=mock.mock_open)
|
||||
def test_import_builds_from_local_dnf_repos(self, patched_open):
|
||||
pytest.importorskip("dnf")
|
||||
|
||||
with patch("dnf.Base") as dnf_base:
|
||||
repo = mock.MagicMock()
|
||||
repo.repofile = "/etc/yum.repos.d/foo.repo"
|
||||
@@ -1265,9 +1263,7 @@ class TestOfflineLocalBuilds:
|
||||
repo.get_metadata_content.return_value = f.read()
|
||||
base = dnf_base.return_value
|
||||
base.repos = {"reponame": repo}
|
||||
|
||||
patched_open.return_value = mock.mock_open(
|
||||
read_data="FOO=bar\nPLATFORM_ID=platform:x\n").return_value
|
||||
patched_open.return_value.readlines.return_value = ('FOO=bar', 'PLATFORM_ID=platform:x')
|
||||
|
||||
module_build_service.utils.import_builds_from_local_dnf_repos()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user