mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add unit test for broken CPE_NAME
This commit is contained in:
parent
1306ddb111
commit
712083df0e
1 changed files with 10 additions and 0 deletions
|
@ -111,6 +111,16 @@ class CoreGrainsTestCase(TestCase, LoaderModuleMockMixin):
|
|||
for key in cpe_ret:
|
||||
assert key in ret
|
||||
assert cpe_ret[key] == ret[key]
|
||||
|
||||
def test_parse_cpe_name_broken(self):
|
||||
'''
|
||||
Parse broken CPE_NAME data
|
||||
:return:
|
||||
'''
|
||||
for cpe in ['cpe:broken', 'cpe:broken:in:all:ways:*:*:*:*',
|
||||
'cpe:x:still:broken:123', 'who:/knows:what:is:here']:
|
||||
assert core._parse_cpe_name(cpe) == {}
|
||||
|
||||
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')
|
||||
|
|
Loading…
Add table
Reference in a new issue