From c393625dfa2a473ecb4f05c7a583f5d9a6fb48e9 Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Thu, 9 Oct 2014 13:30:35 +1300 Subject: [PATCH] Support files for unit test of software-config hooks This change adds a tox.ini file including environments for py26, py27 and pep8. These will be used to unit test the hot software-config hooks. Change-Id: Ieea12be77205d777a6b9c0f1c239418b9ce59d9f --- .gitignore | 5 +++++ .testr.conf | 4 ++++ requirements.txt | 0 test-requirements.txt | 14 ++++++++++++++ tox.ini | 21 +++++++++++++++++++++ 5 files changed, 44 insertions(+) create mode 100644 .testr.conf create mode 100644 requirements.txt create mode 100644 test-requirements.txt create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index e4078ff4..55faa277 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ +*.pyc +*.swp +*~ +.tox cfn/cloudformation-examples/ private +.testrepository diff --git a/.testr.conf b/.testr.conf new file mode 100644 index 00000000..a2ff14b2 --- /dev/null +++ b/.testr.conf @@ -0,0 +1,4 @@ +[DEFAULT] +test_command=${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION +test_id_option=--load-list $IDFILE +test_list_option=--list diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..e69de29b diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 00000000..1c75dc0b --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,14 @@ +coverage>=3.6 +discover +fixtures>=0.3.14 +# Hacking already pins down pep8, pyflakes and flake8 +hacking>=0.8.0,<0.9 +mock>=1.0 +requests>=1.2.1,!=2.4.0 +requests-mock>=0.4.0 # Apache-2.0 +testrepository>=0.0.18 +testscenarios>=0.4 +testtools>=0.9.34 + +python-heatclient>=0.2.9 +python-keystoneclient>=0.10.0 diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..c4b2fb06 --- /dev/null +++ b/tox.ini @@ -0,0 +1,21 @@ +[tox] +envlist = py26,py27,pep8 +minversion = 1.6 +skipsdist = True + +[testenv] +setenv = VIRTUAL_ENV={envdir} +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +commands = testr run {posargs} + +[testenv:pep8] +commands = flake8 + +[testenv:venv] +commands = {posargs} + +[flake8] +show-source = True +builtins = _ +exclude=.venv,.git,.tox,*lib/python*,private \ No newline at end of file