Add UT for typecheck on the output data

This commit is contained in:
Bo Maryniuk 2017-05-24 11:46:55 +02:00
parent 20ff494b93
commit 0bf0950158

View File

@ -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('')