Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP3:GA
salt.10899
fix-unit-test-for-grains-core.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fix-unit-test-for-grains-core.patch of Package salt.10899
From 2514600fdc2820efb93fa7863c5c494bb794a125 Mon Sep 17 00:00:00 2001 From: Bo Maryniuk <bo@suse.de> Date: Thu, 11 Oct 2018 15:44:23 +0200 Subject: [PATCH] Fix unit test for grains core --- tests/unit/grains/test_core.py | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/tests/unit/grains/test_core.py b/tests/unit/grains/test_core.py index 3b930b0475..428e523567 100644 --- a/tests/unit/grains/test_core.py +++ b/tests/unit/grains/test_core.py @@ -55,30 +55,6 @@ class CoreGrainsTestCase(TestCase, LoaderModuleMockMixin): def setup_loader_modules(self): return {core: {}} - @patch("os.path.isfile") - def test_parse_etc_os_release(self, path_isfile_mock): - path_isfile_mock.side_effect = lambda x: x == "/usr/lib/os-release" - with salt.utils.files.fopen(os.path.join(OS_RELEASE_DIR, "ubuntu-17.10")) as os_release_file: - os_release_content = os_release_file.read() - with patch("salt.utils.files.fopen", mock_open(read_data=os_release_content)): - os_release = core._parse_os_release( - '/etc/os-release', - '/usr/lib/os-release') - self.assertEqual(os_release, { - "NAME": "Ubuntu", - "VERSION": "17.10 (Artful Aardvark)", - "ID": "ubuntu", - "ID_LIKE": "debian", - "PRETTY_NAME": "Ubuntu 17.10", - "VERSION_ID": "17.10", - "HOME_URL": "https://www.ubuntu.com/", - "SUPPORT_URL": "https://help.ubuntu.com/", - "BUG_REPORT_URL": "https://bugs.launchpad.net/ubuntu/", - "PRIVACY_POLICY_URL": "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy", - "VERSION_CODENAME": "artful", - "UBUNTU_CODENAME": "artful", - }) - def test_parse_cpe_name_wfn(self): ''' Parse correct CPE_NAME data WFN formatted @@ -125,7 +101,7 @@ class CoreGrainsTestCase(TestCase, LoaderModuleMockMixin): def test_missing_os_release(self): with patch('salt.utils.files.fopen', mock_open(read_data={})): - os_release = core._parse_os_release('/etc/os-release', '/usr/lib/os-release') + os_release = core._parse_os_release() self.assertEqual(os_release, {}) @skipIf(not salt.utils.platform.is_linux(), 'System is not Linux') -- 2.19.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor