Created
May 22, 2009 17:40
-
-
Save srid/116260 to your computer and use it in GitHub Desktop.
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
def test_typical_usecase(): | |
"""Test the typical use case, which is to - | |
1) update 2) search 3) install 4) remove | |
.. and 5) import | |
""" | |
packages = packages_small_list | |
c, repo_root_url = prepare_client(packages) | |
c.do_update(None, None, repo_root_url) | |
def test_search(): | |
for pkg in packages: | |
sample_keyword = pkg['name'][:3] | |
logger.info('Searching for `%s` expecting `%s`', sample_keyword, pkg['name']) | |
results = [p.name for p in c.do_search(None, None, sample_keyword)] | |
logger.info('Got results: %s', results) | |
assert pkg['name'] in results | |
def test_list_all(all_status): | |
opts.all = True | |
for ipkg in c.do_list(None, opts): | |
assert ipkg.status == all_status | |
assert ipkg.pkg.name in [p['name'] for p in packages] | |
def test_install(): | |
for pkg in packages: | |
c.do_install(None, opts, pkg['name']) | |
shownpkg = c.do_show(None, None, pkg['name']) | |
assert shownpkg.name == pkg['name'] | |
def test_import(): | |
for pkg in packages: | |
c.pypmenv.pyenv.eval( | |
'', | |
pkg['imports'], | |
) | |
def test_list(): | |
opts.all = False | |
for ipkg in c.do_list(None, opts): | |
assert ipkg.pkg.name in [p['name'] for p in packages] | |
def test_remove(): | |
for pkg in packages: | |
c.do_remove(None, None, pkg['name']) | |
test_search() | |
test_list_all(inspect.Inspector.InspectedPackage.NOTINSTALLED) | |
test_install() | |
test_list_all(inspect.Inspector.InspectedPackage.INSTALLED) | |
test_list() | |
test_import() | |
test_remove() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment