-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55258 from mateiw/master-aptpkg-info-only-installed
Make aptpkg.info return only installed packages
- Loading branch information
Showing
2 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,7 +90,26 @@ | |
'name': 'wget', | ||
'section': 'web', | ||
'source': 'wget', | ||
'version': '1.15-1ubuntu1.14.04.2' | ||
'version': '1.15-1ubuntu1.14.04.2', | ||
'status': 'ii', | ||
}, | ||
'apache2': { | ||
'architecture': 'amd64', | ||
'description': """Apache HTTP Server | ||
The Apache HTTP Server Project's goal is to build a secure, efficient and | ||
extensible HTTP server as standards-compliant open source software. The | ||
result has long been the number one web server on the Internet. | ||
. | ||
Installing this package results in a full installation, including the | ||
configuration files, init scripts and support scripts.""", | ||
'homepage': 'http://httpd.apache.org/', | ||
'install_date': '2016-08-30T22:20:15Z', | ||
'maintainer': 'Ubuntu Developers <[email protected]>', | ||
'name': 'apache2', | ||
'section': 'httpd', | ||
'source': 'apache2', | ||
'version': '2.4.18-2ubuntu3.9', | ||
'status': 'rc', | ||
} | ||
} | ||
|
||
|
@@ -244,14 +263,16 @@ def test_info_installed(self): | |
'url': 'homepage' | ||
} | ||
|
||
installed = copy.deepcopy(LOWPKG_INFO) | ||
installed = copy.deepcopy({'wget': LOWPKG_INFO['wget']}) | ||
for name in names: | ||
if installed['wget'].get(names[name], False): | ||
installed['wget'][name] = installed['wget'].pop(names[name]) | ||
|
||
mock = MagicMock(return_value=LOWPKG_INFO) | ||
with patch.dict(aptpkg.__salt__, {'lowpkg.info': mock}): | ||
del installed['wget']['status'] | ||
self.assertEqual(aptpkg.info_installed('wget'), installed) | ||
self.assertEqual(len(aptpkg.info_installed()), 1) | ||
|
||
def test_owner(self): | ||
''' | ||
|