Merge "Remove old generate_random_name() use from sahara context"
This commit is contained in:
commit
dde6a8cfad
@ -60,8 +60,7 @@ class SaharaOutputDataSources(context.Context):
|
|||||||
if self.config["output_type"] == "swift":
|
if self.config["output_type"] == "swift":
|
||||||
swift = swift_utils.SwiftScenario(clients=clients,
|
swift = swift_utils.SwiftScenario(clients=clients,
|
||||||
context=self.context)
|
context=self.context)
|
||||||
container_name = rutils.generate_random_name(
|
container_name = self.generate_random_name()
|
||||||
prefix=self.config["output_url_prefix"])
|
|
||||||
self.context["tenants"][tenant_id]["sahara"]["container"] = {
|
self.context["tenants"][tenant_id]["sahara"]["container"] = {
|
||||||
"name": swift._create_container(
|
"name": swift._create_container(
|
||||||
container_name=container_name),
|
container_name=container_name),
|
||||||
|
@ -106,11 +106,8 @@ class SaharaOutputDataSourcesTestCase(test.ScenarioTestCase):
|
|||||||
names=["sahara.data_sources"],
|
names=["sahara.data_sources"],
|
||||||
users=self.context["users"])
|
users=self.context["users"])
|
||||||
|
|
||||||
@mock.patch("rally.common.utils.generate_random_name",
|
|
||||||
return_value="rally")
|
|
||||||
@mock.patch("%s.sahara_output_data_sources.osclients" % CTX)
|
@mock.patch("%s.sahara_output_data_sources.osclients" % CTX)
|
||||||
def test_setup_inputs_swift(self, mock_osclients,
|
def test_setup_inputs_swift(self, mock_osclients):
|
||||||
mock_generate_random_name):
|
|
||||||
mock_sahara = mock_osclients.Clients(mock.MagicMock()).sahara()
|
mock_sahara = mock_osclients.Clients(mock.MagicMock()).sahara()
|
||||||
|
|
||||||
self.context.update({
|
self.context.update({
|
||||||
@ -132,15 +129,15 @@ class SaharaOutputDataSourcesTestCase(test.ScenarioTestCase):
|
|||||||
|
|
||||||
sahara_ctx = sahara_output_data_sources.SaharaOutputDataSources(
|
sahara_ctx = sahara_output_data_sources.SaharaOutputDataSources(
|
||||||
self.context)
|
self.context)
|
||||||
sahara_ctx.generate_random_name = mock.Mock()
|
sahara_ctx.generate_random_name = mock.Mock(return_value="random_name")
|
||||||
|
|
||||||
output_ds_crete_calls = []
|
output_ds_crete_calls = []
|
||||||
for i in range(self.tenants_num):
|
for i in range(self.tenants_num):
|
||||||
output_ds_crete_calls.append(mock.call(
|
output_ds_crete_calls.append(mock.call(
|
||||||
name=sahara_ctx.generate_random_name.return_value,
|
name="random_name",
|
||||||
description="",
|
description="",
|
||||||
data_source_type="swift",
|
data_source_type="swift",
|
||||||
url="swift://rally.sahara/",
|
url="swift://random_name.sahara/",
|
||||||
credential_user="user",
|
credential_user="user",
|
||||||
credential_pass="passwd"
|
credential_pass="passwd"
|
||||||
))
|
))
|
||||||
|
Loading…
Reference in New Issue
Block a user