SHA256
1
0
forked from pool/salt
salt/fix-zypper-pkg.list_pkgs-expectation-and-dpkg-mockin.patch

54 lines
2.1 KiB
Diff

From 81f38c8cb16634b2c86b3e1e7c745870f90771d0 Mon Sep 17 00:00:00 2001
From: Mihai Dinca <mdinca@suse.de>
Date: Thu, 13 Jun 2019 17:48:55 +0200
Subject: [PATCH] Fix zypper pkg.list_pkgs expectation and dpkg mocking
---
tests/unit/modules/test_dpkg_lowpkg.py | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/tests/unit/modules/test_dpkg_lowpkg.py b/tests/unit/modules/test_dpkg_lowpkg.py
index 160bbcd5b1..dadbc30dfa 100644
--- a/tests/unit/modules/test_dpkg_lowpkg.py
+++ b/tests/unit/modules/test_dpkg_lowpkg.py
@@ -308,9 +308,14 @@ class DpkgTestCase(TestCase, LoaderModuleMockMixin):
dpkg.bin_pkg_info("package.deb")["name"], "package_name"
)
- @patch("salt.modules.dpkg._get_pkg_ds_avail", MagicMock(return_value=dselect_pkg))
- @patch("salt.modules.dpkg._get_pkg_info", MagicMock(return_value=pkgs_info))
- @patch("salt.modules.dpkg._get_pkg_license", MagicMock(return_value="BSD v3"))
+ @patch(
+ "salt.modules.dpkg_lowpkg._get_pkg_ds_avail",
+ MagicMock(return_value=dselect_pkg),
+ )
+ @patch("salt.modules.dpkg_lowpkg._get_pkg_info", MagicMock(return_value=pkgs_info))
+ @patch(
+ "salt.modules.dpkg_lowpkg._get_pkg_license", MagicMock(return_value="BSD v3")
+ )
def test_info(self):
"""
Test info
@@ -359,9 +364,14 @@ class DpkgTestCase(TestCase, LoaderModuleMockMixin):
)
assert pkg_data["license"] == "BSD v3"
- @patch("salt.modules.dpkg._get_pkg_ds_avail", MagicMock(return_value=dselect_pkg))
- @patch("salt.modules.dpkg._get_pkg_info", MagicMock(return_value=pkgs_info))
- @patch("salt.modules.dpkg._get_pkg_license", MagicMock(return_value="BSD v3"))
+ @patch(
+ "salt.modules.dpkg_lowpkg._get_pkg_ds_avail",
+ MagicMock(return_value=dselect_pkg),
+ )
+ @patch("salt.modules.dpkg_lowpkg._get_pkg_info", MagicMock(return_value=pkgs_info))
+ @patch(
+ "salt.modules.dpkg_lowpkg._get_pkg_license", MagicMock(return_value="BSD v3")
+ )
def test_info_attr(self):
"""
Test info with 'attr' parameter
--
2.29.2