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:
parent
0124ed60e8
commit
607acaf857
18
setup.py
18
setup.py
|
@ -3,6 +3,7 @@ from setuptools import setup, find_packages
|
||||||
|
|
||||||
from packstack import version
|
from packstack import version
|
||||||
|
|
||||||
|
|
||||||
# Utility function to read the README file.
|
# Utility function to read the README file.
|
||||||
# Used for the long_description. It's nice, because now 1) we have a top level
|
# 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
|
# 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()
|
return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name = "packstack",
|
name="packstack",
|
||||||
version = version.version_string(),
|
version=version.version_string(),
|
||||||
author = "Derek Higgins",
|
author="Derek Higgins",
|
||||||
author_email = "derekh@redhat.com",
|
author_email="derekh@redhat.com",
|
||||||
description = ("A utility to install openstack"),
|
description=("A utility to install openstack"),
|
||||||
license = "ASL 2.0",
|
license="ASL 2.0",
|
||||||
keywords = "openstack",
|
keywords="openstack",
|
||||||
url = "https://github.com/fedora-openstack/packstack",
|
url="https://github.com/fedora-openstack/packstack",
|
||||||
packages=find_packages('.'),
|
packages=find_packages('.'),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
long_description=read('README'),
|
long_description=read('README'),
|
||||||
|
@ -30,4 +31,3 @@ setup(
|
||||||
],
|
],
|
||||||
scripts=["bin/packstack"]
|
scripts=["bin/packstack"]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -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
|
|
@ -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,0 +1,2 @@
|
||||||
|
nose
|
||||||
|
coverage
|
|
@ -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}
|
Loading…
Reference in New Issue