diff options
author | Monty Taylor <mordred@inaugust.com> | 2012-03-21 10:34:46 -0400 |
---|---|---|
committer | Monty Taylor <mordred@inaugust.com> | 2012-03-21 10:48:51 -0400 |
commit | 6d67b4a6a24a9ed7eade711dd4f72bc3668dd6b4 (patch) | |
tree | 2665871ea63209034c8b49da644a47d52ca195c2 | |
parent | 77742d7b134bd2066ea42982637a798c1d1cf068 (diff) | |
download | python-keystoneclient-6d67b4a6a24a9ed7eade711dd4f72bc3668dd6b4.tar.gz |
Updated tox.ini to work properly with Jenkins.
As part of doing that, fixed a unittest to work with python2.6.
Change-Id: I575a8534bf008077c1a24a25336f1d711f742297
-rw-r--r-- | setup.cfg | 1 | ||||
-rw-r--r-- | setup.py | 28 | ||||
-rw-r--r-- | tests/v2_0/test_auth.py | 7 | ||||
-rw-r--r-- | tools/pip-requires | 1 | ||||
-rw-r--r-- | tox.ini | 34 |
5 files changed, 49 insertions, 22 deletions
@@ -1,6 +1,5 @@ [nosetests] cover-package = keystoneclient -cover-html = true cover-erase = true cover-inclusive = true @@ -13,16 +13,16 @@ if sys.version_info < (2, 7): requirements.append('argparse') setup( - name = "python-keystoneclient", - version = "2012.1", - description = "Client library for OpenStack Keystone API", - long_description = read('README.rst'), - url = 'https://github.com/openstack/python-keystoneclient', - license = 'Apache', - author = 'Nebula Inc, based on work by Rackspace and Jacob Kaplan-Moss', - author_email = 'gabriel.hurley@nebula.com', - packages = find_packages(exclude=['tests', 'tests.*']), - classifiers = [ + name="python-keystoneclient", + version="2012.1", + description="Client library for OpenStack Keystone API", + long_description=read('README.rst'), + url='https://github.com/openstack/python-keystoneclient', + license='Apache', + author='Nebula Inc, based on work by Rackspace and Jacob Kaplan-Moss', + author_email='gabriel.hurley@nebula.com', + packages=find_packages(exclude=['tests', 'tests.*']), + classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Intended Audience :: Developers', @@ -31,12 +31,12 @@ setup( 'Operating System :: OS Independent', 'Programming Language :: Python', ], - install_requires = requirements, + install_requires=requirements, - tests_require = ["nose", "mock", "mox"], - test_suite = "nose.collector", + tests_require=["nose", "mock", "mox"], + test_suite="nose.collector", - entry_points = { + entry_points={ 'console_scripts': ['keystone = keystoneclient.shell:main'] } ) diff --git a/tests/v2_0/test_auth.py b/tests/v2_0/test_auth.py index f9f90d4..8dc4c11 100644 --- a/tests/v2_0/test_auth.py +++ b/tests/v2_0/test_auth.py @@ -78,12 +78,17 @@ class AuthenticateAgainstKeystoneTests(utils.TestCase): .AndReturn((resp, resp['body'])) self.mox.ReplayAll() - with self.assertRaises(exceptions.Unauthorized): + # Workaround for issue with assertRaises on python2.6 + # where with assertRaises(exceptions.Unauthorized): doesn't work + # right + def client_create_wrapper(): client.Client(username=self.TEST_USER, password="bad_key", tenant_id=self.TEST_TENANT_ID, auth_url=self.TEST_URL) + self.assertRaises(exceptions.Unauthorized, client_create_wrapper) + def test_auth_redirect(self): correct_response = json.dumps(self.TEST_RESPONSE_DICT) dict_responses = [ diff --git a/tools/pip-requires b/tools/pip-requires index af3712d..9aa889e 100644 --- a/tools/pip-requires +++ b/tools/pip-requires @@ -4,6 +4,7 @@ httplib2 mock mox nose +nosexcover pep8 prettytable simplejson @@ -1,14 +1,36 @@ [tox] -envlist = py26,py27 +envlist = py26,py27,pep8 [testenv] +setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/tools/pip-requires -commands = /bin/bash run_tests.sh -N +commands = nosetests {posargs} [testenv:pep8] deps = pep8 -commands = /bin/bash run_tests.sh -N --pep8 +commands = pep8 --repeat --show-source keystoneclient setup.py -[testenv:coverage] -deps = pep8 -commands = /bin/bash run_tests.sh -N --with-coverage +[testenv:cover] +commands = nosetests --with-xcoverage {posargs} + +[testenv:venv] +commands = {posargs} + +[testenv:hudson] +downloadcache = ~/cache/pip + +[testenv:jenkins26] +basepython = python2.6 +deps = file://{toxinidir}/.cache.bundle + +[testenv:jenkins27] +basepython = python2.7 +deps = file://{toxinidir}/.cache.bundle + +[testenv:jenkinscover] +deps = file://{toxinidir}/.cache.bundle +commands = nosetests --with-xcoverage {posargs} + +[testenv:jenkinsvenv] +deps = file://{toxinidir}/.cache.bundle +commands = {posargs} |