From 7feec32f777dc5ba59ca8e8c448143d85f245f5a Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam Date: Tue, 16 Feb 2016 15:33:48 +0530 Subject: [PATCH] Fixed unit testing issues Change-Id: I28ca9764a845104a6b13a55ceb3d11b7ac187e6b --- .gitignore | 56 +++++++++++++++++++++++++++ .testr.conf | 7 ++++ namosclient/__init__.py | 19 +++++++++ namosclient/tests/__init__.py | 0 namosclient/tests/base.py | 23 +++++++++++ namosclient/tests/test_namosclient.py | 28 ++++++++++++++ 6 files changed, 133 insertions(+) create mode 100644 .gitignore create mode 100644 .testr.conf create mode 100644 namosclient/__init__.py create mode 100644 namosclient/tests/__init__.py create mode 100644 namosclient/tests/base.py create mode 100644 namosclient/tests/test_namosclient.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..71babc6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,56 @@ +*.py[cod] + +# C extensions +*.so + +# Packages +*.egg* +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg +lib +lib64 + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +cover/ +.coverage* +!.coveragerc +.tox +nosetests.xml +.testrepository +.venv + +# Translations +*.mo + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject +.idea + +# Complexity +output/*.html +output/*/index.html + +# Sphinx +doc/build + +# pbr generates these +AUTHORS +ChangeLog + +# Editors +*~ +.*.swp +.*sw? diff --git a/.testr.conf b/.testr.conf new file mode 100644 index 0000000..6d83b3c --- /dev/null +++ b/.testr.conf @@ -0,0 +1,7 @@ +[DEFAULT] +test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ + OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ + OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \ + ${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION +test_id_option=--load-list $IDFILE +test_list_option=--list diff --git a/namosclient/__init__.py b/namosclient/__init__.py new file mode 100644 index 0000000..4478bd3 --- /dev/null +++ b/namosclient/__init__.py @@ -0,0 +1,19 @@ +# -*- 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. + +import pbr.version + + +__version__ = pbr.version.VersionInfo( + 'namosclient').version_string() diff --git a/namosclient/tests/__init__.py b/namosclient/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/namosclient/tests/base.py b/namosclient/tests/base.py new file mode 100644 index 0000000..1c30cdb --- /dev/null +++ b/namosclient/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/namosclient/tests/test_namosclient.py b/namosclient/tests/test_namosclient.py new file mode 100644 index 0000000..cf9945d --- /dev/null +++ b/namosclient/tests/test_namosclient.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_python-namosclient +---------------------------------- + +Tests for `namosclient` module. +""" + +from namosclient.tests import base + + +class TestNamosclient(base.TestCase): + + def test_something(self): + pass