From ea266aa6176b67d32fd4ee13b621718db57c3b80 Mon Sep 17 00:00:00 2001 From: Tim Buckley Date: Mon, 3 Aug 2015 10:37:55 -0600 Subject: [PATCH] Add stub unit tests from cookiecutter --- babel.cfg | 2 ++ stackviz/tests/__init__.py | 0 stackviz/tests/base.py | 23 ++++++++++++++++++++++ stackviz/tests/test_stackviz.py | 28 ++++++++++++++++++++++++++ test-requirements.txt | 15 ++++++++++++++ tox.ini | 35 +++++++++++++++++++++++++++++++++ 6 files changed, 103 insertions(+) create mode 100644 babel.cfg create mode 100644 stackviz/tests/__init__.py create mode 100644 stackviz/tests/base.py create mode 100644 stackviz/tests/test_stackviz.py create mode 100644 test-requirements.txt create mode 100644 tox.ini diff --git a/babel.cfg b/babel.cfg new file mode 100644 index 0000000..15cd6cb --- /dev/null +++ b/babel.cfg @@ -0,0 +1,2 @@ +[python: **.py] + diff --git a/stackviz/tests/__init__.py b/stackviz/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/stackviz/tests/base.py b/stackviz/tests/base.py new file mode 100644 index 0000000..1c30cdb --- /dev/null +++ b/stackviz/tests/base.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- + +# Copyright 2010-2011 OpenStack Foundation +# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. +# +# 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. + +from oslotest import base + + +class TestCase(base.BaseTestCase): + + """Test case base class for all unit tests.""" diff --git a/stackviz/tests/test_stackviz.py b/stackviz/tests/test_stackviz.py new file mode 100644 index 0000000..07d5029 --- /dev/null +++ b/stackviz/tests/test_stackviz.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- + +# 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. + +""" +test_stackviz +---------------------------------- + +Tests for `stackviz` module. +""" + +from stackviz.tests import base + + +class TestStackviz(base.TestCase): + + def test_something(self): + pass diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..8592bde --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,15 @@ +# 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.10.0 + +coverage>=3.6 +discover +python-subunit>=0.0.18 +sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 +oslosphinx>=2.2.0 # Apache-2.0 +oslotest>=1.2.0 # Apache-2.0 +testrepository>=0.0.18 +testscenarios>=0.4 +testtools>=0.9.36,!=1.2.0 diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..73ef134 --- /dev/null +++ b/tox.ini @@ -0,0 +1,35 @@ +[tox] +minversion = 1.6 +envlist = py33,py34,py26,py27,pypy,pep8 +skipsdist = True + +[testenv] +usedevelop = True +install_command = pip install -U {opts} {packages} +setenv = + VIRTUAL_ENV={envdir} +deps = -r{toxinidir}/test-requirements.txt +commands = python setup.py test --slowest --testr-args='{posargs}' + +[testenv:pep8] +commands = flake8 + +[testenv:venv] +commands = {posargs} + +[testenv:cover] +commands = python setup.py test --coverage --testr-args='{posargs}' + +[testenv:docs] +commands = python setup.py build_sphinx + +[testenv:debug] +commands = oslo_debug_helper {posargs} + +[flake8] +# E123, E125 skipped as they are invalid PEP-8. + +show-source = True +ignore = E123,E125 +builtins = _ +exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build