From 97c7c806ef7b9f18b477a3e0d94b97c3bdab9d83 Mon Sep 17 00:00:00 2001 From: Ekaterina Fedorova Date: Mon, 28 Jul 2014 15:14:45 +0400 Subject: [PATCH] Move functional tests under muranodashboard/tests This patch allows to run functional tests under devstack Rename muranodashboard/test to muranodashboard/tests Partly-Closes-Bug: #1349383 Change-Id: I70ac476cce9e037b8f36872dde3c1825ca6e3a04 --- .gitignore | 2 +- {functionaltests => muranodashboard/tests}/__init__.py | 0 .../functional}/MockApp/Classes/mock_muranopl.yaml | 0 .../tests/functional}/MockApp/UI/mock_ui.yaml | 0 .../tests/functional}/__init__.py | 0 .../tests/functional}/base.py | 4 ++-- .../{test => tests/functional/config}/__init__.py | 0 .../tests/functional}/config/config.py | 0 .../tests/functional}/config/config_file.conf | 0 .../tests/functional}/consts.py | 0 .../tests/functional}/sanity_check.py | 10 +++------- .../tests/functional}/utils.py | 2 +- muranodashboard/{test => tests}/settings.py | 0 muranodashboard/{test => tests}/test_fields.py | 0 muranodashboard/{test => tests}/test_tabs.py | 0 muranodashboard/{test => tests}/test_utils.py | 0 tox.ini | 2 +- 17 files changed, 8 insertions(+), 12 deletions(-) rename {functionaltests => muranodashboard/tests}/__init__.py (100%) rename {functionaltests => muranodashboard/tests/functional}/MockApp/Classes/mock_muranopl.yaml (100%) rename {functionaltests => muranodashboard/tests/functional}/MockApp/UI/mock_ui.yaml (100%) rename {functionaltests/config => muranodashboard/tests/functional}/__init__.py (100%) rename {functionaltests => muranodashboard/tests/functional}/base.py (98%) rename muranodashboard/{test => tests/functional/config}/__init__.py (100%) rename {functionaltests => muranodashboard/tests/functional}/config/config.py (100%) rename {functionaltests => muranodashboard/tests/functional}/config/config_file.conf (100%) rename {functionaltests => muranodashboard/tests/functional}/consts.py (100%) rename {functionaltests => muranodashboard/tests/functional}/sanity_check.py (99%) rename {functionaltests => muranodashboard/tests/functional}/utils.py (98%) rename muranodashboard/{test => tests}/settings.py (100%) rename muranodashboard/{test => tests}/test_fields.py (100%) rename muranodashboard/{test => tests}/test_tabs.py (100%) rename muranodashboard/{test => tests}/test_utils.py (100%) diff --git a/.gitignore b/.gitignore index 2ddbe95dd..ce392100f 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,4 @@ dist doc/source/api # Tests -functionaltests/config/config_file.conf +muranodashboard/test/functional/config/config_file.conf diff --git a/functionaltests/__init__.py b/muranodashboard/tests/__init__.py similarity index 100% rename from functionaltests/__init__.py rename to muranodashboard/tests/__init__.py diff --git a/functionaltests/MockApp/Classes/mock_muranopl.yaml b/muranodashboard/tests/functional/MockApp/Classes/mock_muranopl.yaml similarity index 100% rename from functionaltests/MockApp/Classes/mock_muranopl.yaml rename to muranodashboard/tests/functional/MockApp/Classes/mock_muranopl.yaml diff --git a/functionaltests/MockApp/UI/mock_ui.yaml b/muranodashboard/tests/functional/MockApp/UI/mock_ui.yaml similarity index 100% rename from functionaltests/MockApp/UI/mock_ui.yaml rename to muranodashboard/tests/functional/MockApp/UI/mock_ui.yaml diff --git a/functionaltests/config/__init__.py b/muranodashboard/tests/functional/__init__.py similarity index 100% rename from functionaltests/config/__init__.py rename to muranodashboard/tests/functional/__init__.py diff --git a/functionaltests/base.py b/muranodashboard/tests/functional/base.py similarity index 98% rename from functionaltests/base.py rename to muranodashboard/tests/functional/base.py index 2191dd0e6..3f333d026 100644 --- a/functionaltests/base.py +++ b/muranodashboard/tests/functional/base.py @@ -13,8 +13,8 @@ from selenium.webdriver.support.ui import WebDriverWait import testtools import config.config as cfg -from functionaltests import consts -from functionaltests import utils +from muranodashboard.tests.functional import consts +from muranodashboard.tests.functional import utils log = logging.getLogger(__name__) log.setLevel(logging.DEBUG) diff --git a/muranodashboard/test/__init__.py b/muranodashboard/tests/functional/config/__init__.py similarity index 100% rename from muranodashboard/test/__init__.py rename to muranodashboard/tests/functional/config/__init__.py diff --git a/functionaltests/config/config.py b/muranodashboard/tests/functional/config/config.py similarity index 100% rename from functionaltests/config/config.py rename to muranodashboard/tests/functional/config/config.py diff --git a/functionaltests/config/config_file.conf b/muranodashboard/tests/functional/config/config_file.conf similarity index 100% rename from functionaltests/config/config_file.conf rename to muranodashboard/tests/functional/config/config_file.conf diff --git a/functionaltests/consts.py b/muranodashboard/tests/functional/consts.py similarity index 100% rename from functionaltests/consts.py rename to muranodashboard/tests/functional/consts.py diff --git a/functionaltests/sanity_check.py b/muranodashboard/tests/functional/sanity_check.py similarity index 99% rename from functionaltests/sanity_check.py rename to muranodashboard/tests/functional/sanity_check.py index af76cd810..66bdb5c32 100644 --- a/functionaltests/sanity_check.py +++ b/muranodashboard/tests/functional/sanity_check.py @@ -1,13 +1,9 @@ -import os -import sys -sys.path.append(os.getcwd()) - from selenium.webdriver.common import by from selenium.webdriver.support.ui import WebDriverWait -from functionaltests import base -from functionaltests import consts as c -from functionaltests import utils +from muranodashboard.tests.functional import base +from muranodashboard.tests.functional import consts as c +from muranodashboard.tests.functional import utils class TestSuiteSmoke(base.UITestCase): diff --git a/functionaltests/utils.py b/muranodashboard/tests/functional/utils.py similarity index 98% rename from functionaltests/utils.py rename to muranodashboard/tests/functional/utils.py index 0cf718331..9bea8f46a 100644 --- a/functionaltests/utils.py +++ b/muranodashboard/tests/functional/utils.py @@ -70,7 +70,7 @@ def screenshot_on_error(test): @functools.wraps(test) def wrapper(*args, **kwargs): try: - log.debug("Executing test: '{0}'".format(test.func_name)) + log.debug("\nExecuting test: '{0}'".format(test.func_name)) test(*args, **kwargs) except Exception as e: log.exception('{0} failed'.format(test.func_name)) diff --git a/muranodashboard/test/settings.py b/muranodashboard/tests/settings.py similarity index 100% rename from muranodashboard/test/settings.py rename to muranodashboard/tests/settings.py diff --git a/muranodashboard/test/test_fields.py b/muranodashboard/tests/test_fields.py similarity index 100% rename from muranodashboard/test/test_fields.py rename to muranodashboard/tests/test_fields.py diff --git a/muranodashboard/test/test_tabs.py b/muranodashboard/tests/test_tabs.py similarity index 100% rename from muranodashboard/test/test_tabs.py rename to muranodashboard/tests/test_tabs.py diff --git a/muranodashboard/test/test_utils.py b/muranodashboard/tests/test_utils.py similarity index 100% rename from muranodashboard/test/test_utils.py rename to muranodashboard/tests/test_utils.py diff --git a/tox.ini b/tox.ini index 328740d85..f5fcd0c75 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,7 @@ deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt http://tarballs.openstack.org/horizon/horizon-master.tar.gz -commands = {toxinidir}/manage.py test muranodashboard --settings=muranodashboard.test.settings +commands = {toxinidir}/manage.py test muranodashboard --settings=muranodashboard.tests.settings [testenv:pep8] sitepackages = False