Updated tox.ini to work properly with Jenkins.
As part of doing that, fixed a unittest to work with python2.6. Change-Id: I575a8534bf008077c1a24a25336f1d711f742297
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
[nosetests]
|
[nosetests]
|
||||||
cover-package = keystoneclient
|
cover-package = keystoneclient
|
||||||
cover-html = true
|
|
||||||
cover-erase = true
|
cover-erase = true
|
||||||
cover-inclusive = true
|
cover-inclusive = true
|
||||||
|
|
||||||
|
28
setup.py
28
setup.py
@@ -13,16 +13,16 @@ if sys.version_info < (2, 7):
|
|||||||
requirements.append('argparse')
|
requirements.append('argparse')
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name = "python-keystoneclient",
|
name="python-keystoneclient",
|
||||||
version = "2012.1",
|
version="2012.1",
|
||||||
description = "Client library for OpenStack Keystone API",
|
description="Client library for OpenStack Keystone API",
|
||||||
long_description = read('README.rst'),
|
long_description=read('README.rst'),
|
||||||
url = 'https://github.com/openstack/python-keystoneclient',
|
url='https://github.com/openstack/python-keystoneclient',
|
||||||
license = 'Apache',
|
license='Apache',
|
||||||
author = 'Nebula Inc, based on work by Rackspace and Jacob Kaplan-Moss',
|
author='Nebula Inc, based on work by Rackspace and Jacob Kaplan-Moss',
|
||||||
author_email = 'gabriel.hurley@nebula.com',
|
author_email='gabriel.hurley@nebula.com',
|
||||||
packages = find_packages(exclude=['tests', 'tests.*']),
|
packages=find_packages(exclude=['tests', 'tests.*']),
|
||||||
classifiers = [
|
classifiers=[
|
||||||
'Development Status :: 4 - Beta',
|
'Development Status :: 4 - Beta',
|
||||||
'Environment :: Console',
|
'Environment :: Console',
|
||||||
'Intended Audience :: Developers',
|
'Intended Audience :: Developers',
|
||||||
@@ -31,12 +31,12 @@ setup(
|
|||||||
'Operating System :: OS Independent',
|
'Operating System :: OS Independent',
|
||||||
'Programming Language :: Python',
|
'Programming Language :: Python',
|
||||||
],
|
],
|
||||||
install_requires = requirements,
|
install_requires=requirements,
|
||||||
|
|
||||||
tests_require = ["nose", "mock", "mox"],
|
tests_require=["nose", "mock", "mox"],
|
||||||
test_suite = "nose.collector",
|
test_suite="nose.collector",
|
||||||
|
|
||||||
entry_points = {
|
entry_points={
|
||||||
'console_scripts': ['keystone = keystoneclient.shell:main']
|
'console_scripts': ['keystone = keystoneclient.shell:main']
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@@ -78,12 +78,17 @@ class AuthenticateAgainstKeystoneTests(utils.TestCase):
|
|||||||
.AndReturn((resp, resp['body']))
|
.AndReturn((resp, resp['body']))
|
||||||
self.mox.ReplayAll()
|
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,
|
client.Client(username=self.TEST_USER,
|
||||||
password="bad_key",
|
password="bad_key",
|
||||||
tenant_id=self.TEST_TENANT_ID,
|
tenant_id=self.TEST_TENANT_ID,
|
||||||
auth_url=self.TEST_URL)
|
auth_url=self.TEST_URL)
|
||||||
|
|
||||||
|
self.assertRaises(exceptions.Unauthorized, client_create_wrapper)
|
||||||
|
|
||||||
def test_auth_redirect(self):
|
def test_auth_redirect(self):
|
||||||
correct_response = json.dumps(self.TEST_RESPONSE_DICT)
|
correct_response = json.dumps(self.TEST_RESPONSE_DICT)
|
||||||
dict_responses = [
|
dict_responses = [
|
||||||
|
@@ -4,6 +4,7 @@ httplib2
|
|||||||
mock
|
mock
|
||||||
mox
|
mox
|
||||||
nose
|
nose
|
||||||
|
nosexcover
|
||||||
pep8
|
pep8
|
||||||
prettytable
|
prettytable
|
||||||
simplejson
|
simplejson
|
||||||
|
34
tox.ini
34
tox.ini
@@ -1,14 +1,36 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = py26,py27
|
envlist = py26,py27,pep8
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
deps = -r{toxinidir}/tools/pip-requires
|
deps = -r{toxinidir}/tools/pip-requires
|
||||||
commands = /bin/bash run_tests.sh -N
|
commands = nosetests {posargs}
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
deps = pep8
|
deps = pep8
|
||||||
commands = /bin/bash run_tests.sh -N --pep8
|
commands = pep8 --repeat --show-source keystoneclient setup.py
|
||||||
|
|
||||||
[testenv:coverage]
|
[testenv:cover]
|
||||||
deps = pep8
|
commands = nosetests --with-xcoverage {posargs}
|
||||||
commands = /bin/bash run_tests.sh -N --with-coverage
|
|
||||||
|
[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}
|
||||||
|
Reference in New Issue
Block a user