Merge "Several test cleanups"
diff --git a/designate_tempest_plugin/tests/api/v2/test_zones.py b/designate_tempest_plugin/tests/api/v2/test_zones.py
index b0abfc9..f97e256 100644
--- a/designate_tempest_plugin/tests/api/v2/test_zones.py
+++ b/designate_tempest_plugin/tests/api/v2/test_zones.py
@@ -11,7 +11,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
-import six
from oslo_log import log as logging
from tempest import test
from tempest.lib import exceptions as lib_exc
@@ -24,12 +23,8 @@
class BaseZonesTest(base.BaseDnsTest):
- def _assertExpected(self, expected, actual):
- for key, value in six.iteritems(expected):
- if key not in ('created_at', 'updated_at', 'version', 'links',
- 'status', 'action'):
- self.assertIn(key, actual)
- self.assertEqual(value, actual[key], key)
+ excluded_keys = ['created_at', 'updated_at', 'version', 'links',
+ 'status', 'action']
class ZonesTest(BaseZonesTest):
@@ -61,7 +56,7 @@
_, body = self.client.show_zone(zone['id'])
LOG.info('Ensure the fetched response matches the created zone')
- self._assertExpected(zone, body)
+ self.assertExpected(zone, body, self.excluded_keys)
@test.attr(type='smoke')
@test.idempotent_id('a4791906-6cd6-4d27-9f15-32273db8bb3d')
@@ -143,7 +138,7 @@
zone['id'], params={'all_projects': True})
LOG.info('Ensure the fetched response matches the created zone')
- self._assertExpected(zone, body)
+ self.assertExpected(zone, body, self.excluded_keys)
class ZoneOwnershipTest(BaseZonesTest):
diff --git a/designate_tempest_plugin/tests/base.py b/designate_tempest_plugin/tests/base.py
index 5bdd0c7..6519a4f 100644
--- a/designate_tempest_plugin/tests/base.py
+++ b/designate_tempest_plugin/tests/base.py
@@ -11,6 +11,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
+import six
from tempest import test
from designate_tempest_plugin import clients
@@ -31,3 +32,9 @@
# NOTE(kiall) We should default to only primary, and request additional
# credentials in the tests that require them.
credentials = ['primary']
+
+ def assertExpected(self, expected, actual, excluded_keys):
+ for key, value in six.iteritems(expected):
+ if key not in excluded_keys:
+ self.assertIn(key, actual)
+ self.assertEqual(value, actual[key], key)