mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Add UT for typecheck on the output data
This commit is contained in:
parent
20ff494b93
commit
0bf0950158
@ -1032,3 +1032,21 @@ Repository 'DUMMY' not found by its alias, number, or URI.
|
||||
_zpr.nolock.xml.call = MagicMock(return_value=minidom.parseString(xmldoc))
|
||||
assert zypper.Wildcard(_zpr)('libzypp', None) is None
|
||||
|
||||
def test_wildcard_to_query_typecheck(self):
|
||||
'''
|
||||
Test wildcard to query typecheck.
|
||||
|
||||
:return:
|
||||
'''
|
||||
xmldoc = """<?xml version='1.0'?><stream>
|
||||
<search-result version="0.0"><solvable-list>
|
||||
<solvable status="installed" name="libzypp" kind="package" edition="16.2.4-19.5" arch="x86_64" repository="foo"/>
|
||||
<solvable status="other-version" name="libzypp" kind="package" edition="16.2.5-25.1" arch="x86_64" repository="foo"/>
|
||||
<solvable status="other-version" name="libzypp" kind="package" edition="17.2.6-27.9.1" arch="x86_64" repository="foo"/>
|
||||
</solvable-list></search-result></stream>
|
||||
"""
|
||||
_zpr = MagicMock()
|
||||
_zpr.nolock.xml.call = MagicMock(return_value=minidom.parseString(xmldoc))
|
||||
|
||||
assert type(zypper.Wildcard(_zpr)('libzypp', '*.1')) is type('')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user