Remove unneeded randomness when calling ddt.data()
The usage of sets introduces unneeded randomness, and the
utils.deduplicate function can be used instead.
This is a follow-up to similar past changes, see:
I9cbd26016238c25487ac8104c1188cd2cf4f467e
I15bfbf6e1ca604f2bf2fcf12dcd4e67bc728fe5e
I8fce553d927da6d94471ecdf4040bbbb4377d9cf
Change-Id: I5477b815f212c5468c5e52905c4e1e1d4ef082bb
diff --git a/manila_tempest_tests/tests/api/test_revert_to_snapshot.py b/manila_tempest_tests/tests/api/test_revert_to_snapshot.py
index dca394a..5eb6915 100644
--- a/manila_tempest_tests/tests/api/test_revert_to_snapshot.py
+++ b/manila_tempest_tests/tests/api/test_revert_to_snapshot.py
@@ -109,8 +109,8 @@
@decorators.idempotent_id('196f2bc5-e13a-4730-ac51-61e339068a06')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@ddt.data(
- *{constants.REVERT_TO_SNAPSHOT_MICROVERSION,
- CONF.share.max_api_microversion}
+ *utils.deduplicate([constants.REVERT_TO_SNAPSHOT_MICROVERSION,
+ CONF.share.max_api_microversion])
)
def test_revert_to_latest_snapshot(self, version):
snapshot = self.create_snapshot_wait_for_active(self.share['id'],
@@ -129,8 +129,8 @@
@decorators.idempotent_id('09bd9942-7ef9-4d24-b2dd-f83bdda27b50')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@ddt.data(
- *{constants.REVERT_TO_SNAPSHOT_MICROVERSION,
- CONF.share.max_api_microversion}
+ *utils.deduplicate([constants.REVERT_TO_SNAPSHOT_MICROVERSION,
+ CONF.share.max_api_microversion])
)
def test_revert_to_previous_snapshot(self, version):
snapshot1 = self.create_snapshot_wait_for_active(
@@ -157,8 +157,8 @@
@tc.skipUnless(CONF.share.run_replication_tests,
'Replication tests are disabled.')
@ddt.data(
- *{constants.REVERT_TO_SNAPSHOT_MICROVERSION,
- CONF.share.max_api_microversion}
+ *utils.deduplicate([constants.REVERT_TO_SNAPSHOT_MICROVERSION,
+ CONF.share.max_api_microversion])
)
def test_revert_to_replicated_snapshot(self, version):
"""Test reverting to a replicated snapshot."""
diff --git a/manila_tempest_tests/tests/api/test_revert_to_snapshot_negative.py b/manila_tempest_tests/tests/api/test_revert_to_snapshot_negative.py
index 96d7f04..95e2c72 100644
--- a/manila_tempest_tests/tests/api/test_revert_to_snapshot_negative.py
+++ b/manila_tempest_tests/tests/api/test_revert_to_snapshot_negative.py
@@ -80,8 +80,8 @@
@decorators.idempotent_id('21dd8561-8913-42a2-a95c-74b536964c94')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(
- *{constants.REVERT_TO_SNAPSHOT_MICROVERSION,
- CONF.share.max_api_microversion}
+ *utils.deduplicate([constants.REVERT_TO_SNAPSHOT_MICROVERSION,
+ CONF.share.max_api_microversion])
)
def test_revert_to_second_latest_snapshot(self, version):
snapshot1 = self.create_snapshot_wait_for_active(
@@ -98,8 +98,8 @@
@decorators.idempotent_id('7360ee16-ac7d-46ce-9c81-251d64fb7434')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(
- *{constants.REVERT_TO_SNAPSHOT_MICROVERSION,
- CONF.share.max_api_microversion}
+ *utils.deduplicate([constants.REVERT_TO_SNAPSHOT_MICROVERSION,
+ CONF.share.max_api_microversion])
)
def test_revert_to_error_snapshot(self, version):
snapshot = self.create_snapshot_wait_for_active(self.share['id'],
@@ -118,8 +118,8 @@
@decorators.idempotent_id('108a451e-a8e9-450f-8f75-53883d58c6be')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(
- *{constants.REVERT_TO_SNAPSHOT_MICROVERSION,
- CONF.share.max_api_microversion}
+ *utils.deduplicate([constants.REVERT_TO_SNAPSHOT_MICROVERSION,
+ CONF.share.max_api_microversion])
)
def test_revert_error_share_to_snapshot(self, version):
snapshot = self.create_snapshot_wait_for_active(self.share['id'],
@@ -143,8 +143,8 @@
@decorators.idempotent_id('29024057-dbbd-4cf6-a796-207dfbd4c3ff')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(
- *{constants.REVERT_TO_SNAPSHOT_MICROVERSION,
- CONF.share.max_api_microversion}
+ *utils.deduplicate([constants.REVERT_TO_SNAPSHOT_MICROVERSION,
+ CONF.share.max_api_microversion])
)
def test_revert_to_missing_snapshot(self, version):
self.assertRaises(exceptions.BadRequest,
@@ -156,8 +156,8 @@
@decorators.idempotent_id('ef706fad-5ac4-41dc-af81-5aa0331560cf')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(
- *{constants.REVERT_TO_SNAPSHOT_MICROVERSION,
- CONF.share.max_api_microversion}
+ *utils.deduplicate([constants.REVERT_TO_SNAPSHOT_MICROVERSION,
+ CONF.share.max_api_microversion])
)
def test_revert_to_invalid_snapshot(self, version):
snapshot = self.create_snapshot_wait_for_active(