2020-04-07 14:14:01 +02:00
|
|
|
From eb51734ad93b1fa0c6bc8fde861fdabfe3e0d6b0 Mon Sep 17 00:00:00 2001
|
2019-06-14 14:50:01 +02:00
|
|
|
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 | 12 ++++++------
|
2020-04-07 14:14:01 +02:00
|
|
|
1 file changed, 6 insertions(+), 6 deletions(-)
|
2019-06-14 14:50:01 +02:00
|
|
|
|
|
|
|
diff --git a/tests/unit/modules/test_dpkg_lowpkg.py b/tests/unit/modules/test_dpkg_lowpkg.py
|
2020-04-07 14:14:01 +02:00
|
|
|
index a0b3346f9d..bc564f080a 100644
|
2019-06-14 14:50:01 +02:00
|
|
|
--- a/tests/unit/modules/test_dpkg_lowpkg.py
|
|
|
|
+++ b/tests/unit/modules/test_dpkg_lowpkg.py
|
2020-04-07 14:14:01 +02:00
|
|
|
@@ -125,9 +125,9 @@ class DpkgTestCase(TestCase, LoaderModuleMockMixin):
|
2019-06-14 14:50:01 +02:00
|
|
|
with patch.dict(dpkg.__salt__, {'cmd.run_all': mock}):
|
|
|
|
self.assertEqual(dpkg.file_dict('httpd'), 'Error: error')
|
|
|
|
|
|
|
|
- @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
|
2020-04-07 14:14:01 +02:00
|
|
|
@@ -152,9 +152,9 @@ class DpkgTestCase(TestCase, LoaderModuleMockMixin):
|
2019-06-14 14:50:01 +02:00
|
|
|
assert pkg_data['maintainer'] == 'Simpsons Developers <simpsons-devel-discuss@lists.springfield.org>'
|
|
|
|
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
|
|
|
|
--
|
2019-11-28 16:41:55 +01:00
|
|
|
2.16.4
|
2019-06-14 14:50:01 +02:00
|
|
|
|
|
|
|
|