Preserve consistency in module namings
We rename several modules in the system (mostly in unit tests) so that their namings become consistent throughout the code. "Consistency" means here following certain rules like "name all deploy engine and server provider modules without _engine.py and _provider.py suffixes" or "name all unit tests like test_<tested_module>.py". We also add a couple of new folders in unit tests so that the unit tests structure strictly resembles that of tested modules. Blueprint unit-tests-refactoring Change-Id: Ia7b6afce0d1e20b969b56301e0c9ad0f94cc60e4
This commit is contained in:
parent
f31d67a715
commit
33dbc6845e
0
tests/deploy/engines/__init__.py
Normal file
0
tests/deploy/engines/__init__.py
Normal file
@ -18,7 +18,7 @@
|
||||
import jsonschema
|
||||
|
||||
from rally import deploy
|
||||
from rally.deploy.engines import dummy_engine
|
||||
from rally.deploy.engines import dummy
|
||||
from rally import test
|
||||
|
||||
|
||||
@ -41,28 +41,28 @@ class TestDummyDeployEngine(test.TestCase):
|
||||
super(TestDummyDeployEngine, self).setUp()
|
||||
|
||||
def test_dummy_egnine_init(self):
|
||||
dummy_engine.DummyEngine(self.deployment)
|
||||
dummy.DummyEngine(self.deployment)
|
||||
|
||||
def test_dummy_engine_deploy(self):
|
||||
engine = dummy_engine.DummyEngine(self.deployment)
|
||||
engine = dummy.DummyEngine(self.deployment)
|
||||
endpoint = engine.deploy()
|
||||
self.assertEqual(endpoint, self.deployment['config']['cloud_config'])
|
||||
|
||||
def test_dummy_engine_cleanup(self):
|
||||
dummy_engine.DummyEngine(self.deployment).cleanup()
|
||||
dummy.DummyEngine(self.deployment).cleanup()
|
||||
|
||||
def test_dummy_engine_is_in_factory(self):
|
||||
name = self.deployment['config']['name']
|
||||
engine = deploy.EngineFactory.get_engine(name,
|
||||
self.deployment)
|
||||
self.assertIsInstance(engine, dummy_engine.DummyEngine)
|
||||
self.assertIsInstance(engine, dummy.DummyEngine)
|
||||
|
||||
def test_init_invalid_config(self):
|
||||
self.deployment['config']['cloud_config']['identity'] = 42
|
||||
self.assertRaises(jsonschema.ValidationError,
|
||||
dummy_engine.DummyEngine, self.deployment)
|
||||
dummy.DummyEngine, self.deployment)
|
||||
|
||||
def test_deploy(self):
|
||||
engine = dummy_engine.DummyEngine(self.deployment)
|
||||
engine = dummy.DummyEngine(self.deployment)
|
||||
self.assertEqual(self.deployment['config']['cloud_config'],
|
||||
engine.deploy())
|
0
tests/serverprovider/providers/__init__.py
Normal file
0
tests/serverprovider/providers/__init__.py
Normal file
Loading…
x
Reference in New Issue
Block a user