Browse Source

Merge "Replace deprecated test.attr with decorators.attr"

Jenkins 1 year ago
parent
commit
3f0887f809

+ 1
- 2
designate_tempest_plugin/tests/api/v2/test_recordset.py View File

@@ -13,7 +13,6 @@
13 13
 #    under the License.
14 14
 from oslo_log import log as logging
15 15
 from tempest import config
16
-from tempest import test
17 16
 from tempest.lib import decorators
18 17
 from tempest.lib import exceptions as lib_exc
19 18
 from tempest.lib.common.utils import data_utils as lib_data_utils
@@ -56,7 +55,7 @@ class RecordsetsTest(BaseRecordsetsTest):
56 55
         cls.client = cls.os.recordset_client
57 56
         cls.zone_client = cls.os.zones_client
58 57
 
59
-    @test.attr(type='smoke')
58
+    @decorators.attr(type='smoke')
60 59
     @decorators.idempotent_id('631d74fd-6909-4684-a61b-5c4d2f92c3e7')
61 60
     def test_create_recordset(self):
62 61
         recordset_data = data_utils.rand_recordset_data(

+ 1
- 2
designate_tempest_plugin/tests/api/v2/test_zones.py View File

@@ -12,7 +12,6 @@
12 12
 # License for the specific language governing permissions and limitations
13 13
 # under the License.
14 14
 from oslo_log import log as logging
15
-from tempest import test
16 15
 from tempest.lib import decorators
17 16
 from tempest.lib import exceptions as lib_exc
18 17
 from tempest.lib.common.utils import data_utils
@@ -57,7 +56,7 @@ class ZonesTest(BaseZonesTest):
57 56
         LOG.info('Ensure the fetched response matches the created zone')
58 57
         self.assertExpected(zone, body, self.excluded_keys)
59 58
 
60
-    @test.attr(type='smoke')
59
+    @decorators.attr(type='smoke')
61 60
     @decorators.idempotent_id('a4791906-6cd6-4d27-9f15-32273db8bb3d')
62 61
     def test_delete_zone(self):
63 62
         LOG.info('Create a zone')

+ 1
- 2
designate_tempest_plugin/tests/api/v2/test_zones_exports.py View File

@@ -13,7 +13,6 @@
13 13
 #    under the License.
14 14
 
15 15
 from oslo_log import log as logging
16
-from tempest import test
17 16
 from tempest.lib import decorators
18 17
 from tempest.lib import exceptions as lib_exc
19 18
 
@@ -47,7 +46,7 @@ class ZonesExportTest(BaseZoneExportsTest):
47 46
         LOG.info('Ensure we respond with PENDING')
48 47
         self.assertEqual('PENDING', zone_export['status'])
49 48
 
50
-    @test.attr(type='smoke')
49
+    @decorators.attr(type='smoke')
51 50
     @decorators.idempotent_id('2d29a2a9-1941-4b7e-9d8a-ad6c2140ea68')
52 51
     def test_show_zone_export(self):
53 52
         LOG.info('Create a zone')

+ 1
- 2
designate_tempest_plugin/tests/api/v2/test_zones_imports.py View File

@@ -13,7 +13,6 @@
13 13
 #    under the License.
14 14
 
15 15
 from oslo_log import log as logging
16
-from tempest import test
17 16
 from tempest.lib import decorators
18 17
 from tempest.lib import exceptions as lib_exc
19 18
 
@@ -42,7 +41,7 @@ class ZonesImportTest(BaseZonesImportTest):
42 41
         LOG.info('Ensure we respond with PENDING')
43 42
         self.assertEqual('PENDING', zone_import['status'])
44 43
 
45
-    @test.attr(type='smoke')
44
+    @decorators.attr(type='smoke')
46 45
     @decorators.idempotent_id('c8909558-0dc6-478a-9e91-eb97b52e59e0')
47 46
     def test_show_zone_import(self):
48 47
         LOG.info('Create a zone import')

+ 5
- 6
designate_tempest_plugin/tests/scenario/v2/test_zones.py View File

@@ -12,7 +12,6 @@
12 12
 # License for the specific language governing permissions and limitations
13 13
 # under the License.
14 14
 from oslo_log import log as logging
15
-from tempest import test
16 15
 from tempest import config
17 16
 from tempest.lib import decorators
18 17
 from tempest.lib import exceptions as lib_exc
@@ -33,8 +32,8 @@ class ZonesTest(base.BaseDnsV2Test):
33 32
         cls.client = cls.os.zones_client
34 33
         cls.query_client = cls.os.query_client
35 34
 
36
-    @test.attr(type='smoke')
37
-    @test.attr(type='slow')
35
+    @decorators.attr(type='smoke')
36
+    @decorators.attr(type='slow')
38 37
     @decorators.idempotent_id('d0648f53-4114-45bd-8792-462a82f69d32')
39 38
     def test_create_and_delete_zone(self):
40 39
         LOG.info('Create a zone')
@@ -65,7 +64,7 @@ class ZonesTest(base.BaseDnsV2Test):
65 64
 
66 65
         waiters.wait_for_zone_404(self.client, zone['id'])
67 66
 
68
-    @test.attr(type='slow')
67
+    @decorators.attr(type='slow')
69 68
     @decorators.idempotent_id('c9838adf-14dc-4097-9130-e5cea3727abb')
70 69
     def test_delete_zone_pending_create(self):
71 70
         LOG.info('Create a zone')
@@ -87,7 +86,7 @@ class ZonesTest(base.BaseDnsV2Test):
87 86
 
88 87
         waiters.wait_for_zone_404(self.client, zone['id'])
89 88
 
90
-    @test.attr(type='slow')
89
+    @decorators.attr(type='slow')
91 90
     @decorators.skip_because(bug='1623576')
92 91
     @decorators.idempotent_id('ad8d1f5b-da66-46a0-bbee-14dc84a5d791')
93 92
     @testtools.skipUnless(
@@ -101,7 +100,7 @@ class ZonesTest(base.BaseDnsV2Test):
101 100
         waiters.wait_for_zone_status(self.client, zone['id'], "ACTIVE")
102 101
         waiters.wait_for_query(self.query_client, zone['name'], "SOA")
103 102
 
104
-    @test.attr(type='slow')
103
+    @decorators.attr(type='slow')
105 104
     @decorators.skip_because(bug='1623576')
106 105
     @decorators.idempotent_id('d13d3095-c78f-4aae-8fe3-a74ccc335c84')
107 106
     @testtools.skipUnless(

+ 1
- 2
designate_tempest_plugin/tests/scenario/v2/test_zones_export.py View File

@@ -13,7 +13,6 @@
13 13
 # under the License.
14 14
 
15 15
 from oslo_log import log as logging
16
-from tempest import test
17 16
 from tempest.lib import decorators
18 17
 
19 18
 from designate_tempest_plugin.common import waiters
@@ -32,7 +31,7 @@ class ZonesExportTest(BaseZoneExportsTest):
32 31
         cls.zones_client = cls.os.zones_client
33 32
         cls.client = cls.os.zone_exports_client
34 33
 
35
-    @test.attr(type='slow')
34
+    @decorators.attr(type='slow')
36 35
     @decorators.idempotent_id('0484c3c4-df57-458e-a6e5-6eb63e0475e0')
37 36
     def test_create_zone_export_and_show_exported_zonefile(self):
38 37
         LOG.info('Create a zone to be exported')

+ 1
- 2
designate_tempest_plugin/tests/scenario/v2/test_zones_import.py View File

@@ -12,7 +12,6 @@
12 12
 # License for the specific language governing permissions and limitations
13 13
 # under the License.
14 14
 from oslo_log import log as logging
15
-from tempest import test
16 15
 from tempest.lib import decorators
17 16
 
18 17
 from designate_tempest_plugin.common import waiters
@@ -31,7 +30,7 @@ class ZonesImportTest(BaseZonesImportTest):
31 30
         cls.client = cls.os.zone_imports_client
32 31
         cls.zones_client = cls.os.zones_client
33 32
 
34
-    @test.attr(type='slow')
33
+    @decorators.attr(type='slow')
35 34
     @decorators.idempotent_id('679f38d0-2f2f-49c5-934e-8fe0c452f56e')
36 35
     def test_create_zone_import_and_wait_for_zone(self):
37 36
         name = dns_data_utils.rand_zone_name('testimport')

+ 4
- 4
doc/source/index.rst View File

@@ -168,7 +168,7 @@ included below:
168 168
 
169 169
            cls.client = cls.os.zones_client
170 170
 
171
-       @test.attr(type='smoke')
171
+       @decorators.attr(type='smoke')
172 172
        @decorators.idempotent_id('fbabd6af-238a-462e-b923-de4d736b90a7')
173 173
        def test_create_zone(self):
174 174
            LOG.info('Create a zone')
@@ -244,7 +244,7 @@ Example:
244 244
            pass
245 245
 
246 246
 
247
-@test.attr
247
+@decorators.attr
248 248
 ~~~~~~~~~~
249 249
 
250 250
 The `attr` decorator is used to set test attributes, this is most commonly used
@@ -259,11 +259,11 @@ Example:
259 259
 .. code-block:: python
260 260
 
261 261
    class ZonesTest(BaseZonesTest):
262
-       @test.attr(type='smoke')
262
+       @decorators.attr(type='smoke')
263 263
        def test_create_zone(self):
264 264
            pass
265 265
 
266
-       @test.attr(type='slow')
266
+       @decorators.attr(type='slow')
267 267
        def test_something_else(self):
268 268
            pass
269 269
 

Loading…
Cancel
Save