Creating a single unit and pep8 test

Starting with one of each to make sure the unit and pep8 gate tests work

Change-Id: Ia4e5595df8937c8612143e19e21e17cfdc18a4b1
This commit is contained in:
Derek Higgins 2013-01-12 00:21:07 +00:00
parent 0124ed60e8
commit 607acaf857
6 changed files with 90 additions and 9 deletions

View File

@ -3,6 +3,7 @@ from setuptools import setup, find_packages
from packstack import version
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
@ -11,14 +12,14 @@ def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "packstack",
version = version.version_string(),
author = "Derek Higgins",
author_email = "derekh@redhat.com",
description = ("A utility to install openstack"),
license = "ASL 2.0",
keywords = "openstack",
url = "https://github.com/fedora-openstack/packstack",
name="packstack",
version=version.version_string(),
author="Derek Higgins",
author_email="derekh@redhat.com",
description=("A utility to install openstack"),
license="ASL 2.0",
keywords="openstack",
url="https://github.com/fedora-openstack/packstack",
packages=find_packages('.'),
include_package_data=True,
long_description=read('README'),
@ -30,4 +31,3 @@ setup(
],
scripts=["bin/packstack"]
)

25
tests/test.py Normal file
View File

@ -0,0 +1,25 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013, Red Hat, Inc.
#
# 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 unittest import TestCase
class TestCase(TestCase):
def setUp(self):
pass
def tearDown(self):
pass

View File

@ -0,0 +1,28 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013, Red Hat, Inc.
#
# 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 test import TestCase
from packstack.modules.ospluginutils import gethostlist
class OSPluginUtilsTestCase(TestCase):
def test_gethostlist(self):
conf = {"A_HOST": "1.1.1.1", "B_HOSTS": "2.2.2.2,1.1.1.1",
"C_HOSTS": "3.3.3.3/vdc"}
hosts = gethostlist(conf)
hosts.sort()
self.assertEquals(['1.1.1.1', '2.2.2.2', '3.3.3.3'], hosts)

0
tools/pip-requires Normal file
View File

2
tools/test-requires Normal file
View File

@ -0,0 +1,2 @@
nose
coverage

26
tox.ini Normal file
View File

@ -0,0 +1,26 @@
[tox]
envlist = py26,py27,pep8
[testenv]
setenv = VIRTUAL_ENV={envdir}
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=C
deps = -r{toxinidir}/tools/pip-requires
-r{toxinidir}/tools/test-requires
commands = nosetests {posargs}
[tox:jenkins]
sitepackages = True
downloadcache = ~/cache/pip
[testenv:pep8]
deps=pep8==1.2
commands = pep8 --exclude=*.pyc --repeat --show-source setup.py
[testenv:cover]
setenv = NOSE_WITH_COVERAGE=1
[testenv:venv]
commands = {posargs}