diff --git a/.gitignore b/.gitignore index 589ed55..3aa62ec 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ adjutantclient/versioninfo .pypirc env/ *~ +.stestr/ diff --git a/.testr.conf b/.testr.conf new file mode 100644 index 0000000..7a2b3df --- /dev/null +++ b/.testr.conf @@ -0,0 +1,4 @@ +[DEFAULT] +test_command=${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./adjutantclient/tests} $LISTOPT $IDOPTION +test_id_option=--load-list $IDFILE +test_list_option=--list diff --git a/adjutantclient/tests/__init__.py b/adjutantclient/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/adjutantclient/tests/v1/__init__.py b/adjutantclient/tests/v1/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/adjutantclient/tests/v1/test_client.py b/adjutantclient/tests/v1/test_client.py new file mode 100644 index 0000000..3a7fe8a --- /dev/null +++ b/adjutantclient/tests/v1/test_client.py @@ -0,0 +1,20 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +import testtools + + +class ClientTest(testtools.TestCase): + + def test_nothing(self): + pass diff --git a/setup.cfg b/setup.cfg index 9bcf1b8..64195f2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,7 +5,7 @@ description-file = README.rst author = Adrian Turjak author-email = adriant@catalyst.net.nz -home-page = https://github.com/catalyst/python-adjutantclient +home-page = https://github.com/openstack/python-adjutantclient classifier = Environment :: OpenStack Intended Audience :: Information Technology diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..2d1a31b --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,21 @@ +# The order of packages is significant, because pip processes them in the order +# of appearance. Changing the order has an impact on the overall integration +# process, which may cause wedges in the gate later. +hacking>=0.11.0,<0.12 # Apache-2.0 +coverage>=3.6 # Apache-2.0 +ddt>=1.0.1 # MIT +discover # BSD +fixtures>=3.0.0 # Apache-2.0/BSD +mock>=2.0 # BSD +requests-mock>=0.7.0 # Apache-2.0 +sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2 # BSD +os-client-config>=1.13.1 # Apache-2.0 +oslosphinx!=3.4.0,>=2.5.0 # Apache-2.0 +testrepository>=0.0.18 # Apache-2.0/BSD +testscenarios>=0.4 # Apache-2.0/BSD +testtools>=1.4.0 # MIT +tempest>=11.0.0 # Apache-2.0 +os-testr>=0.8.0 # Apache-2.0 + +# releasenotes +reno>=1.6.2 # Apache2 \ No newline at end of file diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..156f614 --- /dev/null +++ b/tox.ini @@ -0,0 +1,49 @@ +[tox] +minversion = 1.6 +envlist = py35,py27 +skipsdist = True + +[testenv] +usedevelop = True +install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} +setenv = VIRTUAL_ENV={envdir} + OS_STDOUT_NOCAPTURE=False + OS_STDERR_NOCAPTURE=False + PYTHONHASHSEED=0 +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +commands = ostestr {posargs} + +whitelist_externals = find + +[tox:jenkins] +sitepackages = True + +[testenv:pep8] +commands = flake8 + +[testenv:cover] +commands = + coverage erase + find . -type f -name "*.pyc" -delete + python setup.py testr --coverage --testr-args='{posargs}' + coverage report + +[testenv:venv] +commands = {posargs} + +[testenv:docs] +commands = python setup.py build_sphinx + +[flake8] +show-source = True +exclude=.venv,.git,.tox,dist,*lib/python*,*egg,build,doc/source/conf.py,releasenotes + + +[testenv:bindep] +# Do not install any requirements. We want this to be fast and work even if +# system dependencies are missing, since it's used to tell you what system +# dependencies are missing! This also means that bindep must be installed +# separately, outside of the requirements files. +deps = bindep +commands = bindep test