Allign test requirements to Global Requirements

This patch allignes test requirements to Global Requirements
of the Kilo release of OpenStack both by versions ad by order.
Requirements that are not in Global Requirements list are moved
to the bottom to minimize risk of conflicts.

Partial-bug: #1499659
Change-Id: Idb6b8a459c1e35cddd359fd76c46e6b7a2d0e5da
This commit is contained in:
Roman Prykhodchenko
2015-09-25 16:06:08 +02:00
parent a8298df7de
commit fd68d6090d
9 changed files with 31 additions and 43 deletions

View File

@@ -26,7 +26,7 @@ from fuelclient import consts
from fuelclient import profiler
class Parser:
class Parser(object):
"""Parser class - encapsulates argparse's ArgumentParser
and based on available actions, serializers and additional flags
populates it.

View File

@@ -19,11 +19,7 @@ import subprocess
import sys
import tempfile
try:
from unittest.case import TestCase
except ImportError:
# Runing unit-tests in production environment all
from unittest2.case import TestCase
from oslotest import base as oslo_base
from fuelclient.objects import Release
@@ -48,7 +44,7 @@ class CliExectutionResult(object):
return self.return_code == 0
class BaseTestCase(TestCase):
class BaseTestCase(oslo_base.BaseTestCase):
nailgun_root = os.environ.get('NAILGUN_ROOT', '/tmp/fuel_web/nailgun')
def setUp(self):

View File

@@ -13,15 +13,10 @@
# under the License.
import mock
from oslotest import base as oslo_base
import requests_mock as rm
import six
try:
from unittest.case import TestCase
except ImportError:
# Runing unit-tests in production environment all
from unittest2.case import TestCase
from fuelclient.cli import parser
@@ -40,7 +35,7 @@ class FakeFile(six.StringIO):
pass
class UnitTestCase(TestCase):
class UnitTestCase(oslo_base.BaseTestCase):
"""Base test class which does not require nailgun server to run."""
def setUp(self):

View File

@@ -21,9 +21,9 @@ import tarfile
import time
import mock
import pytest
import requests_mock as rm
from six import moves as six_moves
import testtools
from fuelclient import client
from fuelclient import fuelclient_settings
@@ -33,9 +33,9 @@ from fuelclient.tests.unit.v1 import base
from fuelclient.tests import utils
@pytest.mark.skipif(not profiler.profiling_enabled(),
reason='Performance profiling tests are not '
'enabled in settings.yaml')
@testtools.skipUnless(profiler.profiling_enabled(),
'Performance profiling tests are not '
'enabled in settings.yaml.')
class ClientPerfTest(base.UnitTestCase):
NUMBER_OF_NODES = 100
@@ -43,6 +43,7 @@ class ClientPerfTest(base.UnitTestCase):
@classmethod
def setUpClass(cls):
super(ClientPerfTest, cls).setUpClass()
cls.nodes = cls.get_random_nodes(cls.NUMBER_OF_NODES)
settings = fuelclient_settings.get_settings()
test_base = settings.PERF_TESTS_PATHS['perf_tests_base']

View File

@@ -131,7 +131,7 @@ class TestPluginsActions(base.UnitTestCase):
print_mock,
None,
'Plugins were successfully synchronized.')
sync_mock.assert_called_once()
self.assertTrue(sync_mock.called)
@patch.object(Serializer, 'print_to_output')
@patch.object(Plugins, 'sync')

View File

@@ -18,12 +18,7 @@ import shlex
import sys
import mock
try:
from unittest.case import TestCase
except ImportError:
# Runing unit-tests in production environment all
from unittest2.case import TestCase
from oslotest import base as oslo_base
import fuelclient
from fuelclient.cli import error
@@ -31,7 +26,7 @@ from fuelclient.commands import environment as env
from fuelclient import main as main_mod
class BaseCLITest(TestCase):
class BaseCLITest(oslo_base.BaseTestCase):
"""Base class for testing the new CLI
It mocks the whole API layer in order to be sure the

View File

@@ -16,19 +16,14 @@
import mock
from mock import patch
from oslotest import base as oslo_base
import requests_mock as rm
from six.moves.urllib import parse as urlparse
try:
from unittest.case import TestCase
except ImportError:
# Runing unit-tests in production environment all
from unittest2.case import TestCase
from fuelclient import client
class BaseLibTest(TestCase):
class BaseLibTest(oslo_base.BaseTestCase):
def setUp(self):
super(BaseLibTest, self).setUp()

View File

@@ -1,8 +1,12 @@
hacking==0.7
mock==1.0.1
unittest2
pyprof2calltree==1.3.2
gprof2dot==2014.09.29
requests-mock>=0.6.0
pytest==2.7.2
pytest-cov==2.0.0
hacking>=0.10.0,<0.11
mock>=1.0
oslotest>=1.5.1,<1.6.0 # Apache-2.0
requests-mock>=0.6.0 # Apache-2.0
testtools>=0.9.36,!=1.2.0
# Files beyond this line are not in Global Requirements list
# and must be added there.
pyprof2calltree>=1.3.2
gprof2dot>=2014.09.29
pytest<2.8.0
pytest-cov>=2.0.0

View File

@@ -46,7 +46,7 @@ commands =
downloadcache = ~/cache/pip
[testenv:pep8]
deps = hacking==0.7
deps = hacking==0.10
usedevelop = False
commands =
flake8 {posargs:fuelclient}
@@ -63,7 +63,9 @@ envdir = devenv
usedevelop = True
[flake8]
ignore = H234,H302,H802
# TODO(romcheg): Most of there exceptions must be removed when
# old CLI is removed.
ignore = H234,H302,H802,H405
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,__init__.py,docs
show-pep8 = True
show-source = True