Replace usage of deprecated path for attr decorator

The attr decorator was moved to tempest/lib in 16.1.0 .

[1] 3b46d27c90aa6289724f4c137a0838c89d116b62

Change-Id: I90a07f153a4360b293bf45cb3f81da869f165cc2
This commit is contained in:
Takashi Kajinami 2024-02-09 13:15:04 +09:00
parent f3950af5f1
commit 176242d3bd
4 changed files with 19 additions and 19 deletions

View File

@ -16,8 +16,8 @@
import uuid
from cyborg_tempest_plugin.tests.api import base
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
class AcceleratorRequestNegativeTest(base.BaseAPITest):
@ -28,7 +28,7 @@ class AcceleratorRequestNegativeTest(base.BaseAPITest):
credentials = ['admin']
@test.attr(type=['negative', 'gate'])
@decorators.attr(type=['negative', 'gate'])
def test_get_non_existent_accelerator_request(self):
# get the non-existent accelerator request
non_existent_id = str(uuid.uuid4())
@ -36,7 +36,7 @@ class AcceleratorRequestNegativeTest(base.BaseAPITest):
self.os_admin.cyborg_client.get_accelerator_request,
non_existent_id)
@test.attr(type=['negative', 'gate'])
@decorators.attr(type=['negative', 'gate'])
def test_delete_non_existent_accelerator_request(self):
# delete the non-existent accelerator request
non_existent_id = str(uuid.uuid4())
@ -45,7 +45,7 @@ class AcceleratorRequestNegativeTest(base.BaseAPITest):
self.os_admin.cyborg_client.delete_accelerator_request,
non_existent_id)
@test.attr(type=['negative', 'gate'])
@decorators.attr(type=['negative', 'gate'])
def test_create_accelerator_request_device_profile_name_is_null(self):
# create the accelerator request with device profile name null
dp_mame = {"device_profile_name": ""}
@ -54,7 +54,7 @@ class AcceleratorRequestNegativeTest(base.BaseAPITest):
self.os_admin.cyborg_client.create_accelerator_request,
dp_mame)
@test.attr(type=['negative', 'gate'])
@decorators.attr(type=['negative', 'gate'])
def test_create_accelerator_request_device_profile_name_non_exist(self):
# create the accelerator request with device profile name non_exist
dp_mame = {"device_profile_name": "fake_dp"}
@ -63,7 +63,7 @@ class AcceleratorRequestNegativeTest(base.BaseAPITest):
self.os_admin.cyborg_client.create_accelerator_request,
dp_mame)
@test.attr(type=['negative', 'gate'])
@decorators.attr(type=['negative', 'gate'])
def test_create_accelerator_request_with_special_characters(self):
# create the accelerator request with special characters
dp_mame = {"device_profile_name": "!@#$%^&*()=-[]"}

View File

@ -16,8 +16,8 @@
import uuid
from cyborg_tempest_plugin.tests.api import base
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
class DeployableNegativeTest(base.BaseAPITest):
@ -28,7 +28,7 @@ class DeployableNegativeTest(base.BaseAPITest):
credentials = ['admin']
@test.attr(type=['negative', 'gate'])
@decorators.attr(type=['negative', 'gate'])
def test_get_non_existent_deployable(self):
# get the non-existent deployable
non_existent_id = str(uuid.uuid4())

View File

@ -16,8 +16,8 @@
import uuid
from cyborg_tempest_plugin.tests.api import base
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
class DeviceNegativeTest(base.BaseAPITest):
@ -28,7 +28,7 @@ class DeviceNegativeTest(base.BaseAPITest):
credentials = ['admin']
@test.attr(type=['negative', 'gate'])
@decorators.attr(type=['negative', 'gate'])
def test_get_non_existent_device(self):
# get the non-existent device
non_existent_id = str(uuid.uuid4())

View File

@ -18,8 +18,8 @@ import string
import uuid
from cyborg_tempest_plugin.tests.api import base
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
class DeviceProfileNegativeTest(base.BaseAPITest):
@ -30,7 +30,7 @@ class DeviceProfileNegativeTest(base.BaseAPITest):
credentials = ['admin']
@test.attr(type=['negative', 'gate'])
@decorators.attr(type=['negative', 'gate'])
def test_get_non_existent_device_profile(self):
# get the non-existent device_profile
non_existent_id = str(uuid.uuid4())
@ -38,7 +38,7 @@ class DeviceProfileNegativeTest(base.BaseAPITest):
self.os_admin.cyborg_client.get_device_profile,
non_existent_id)
@test.attr(type=['negative', 'gate'])
@decorators.attr(type=['negative', 'gate'])
def test_delete_non_existent_device_profile(self):
# delete the non-existent device_profile
non_existent_id = str(uuid.uuid4())
@ -47,7 +47,7 @@ class DeviceProfileNegativeTest(base.BaseAPITest):
self.os_admin.cyborg_client.delete_device_profile_by_uuid,
non_existent_id)
@test.attr(type=['negative', 'gate'])
@decorators.attr(type=['negative', 'gate'])
def test_delete_multiple_non_existent_device_profile(self):
# delete multiple non_existent device_profile
self.assertRaises(
@ -56,7 +56,7 @@ class DeviceProfileNegativeTest(base.BaseAPITest):
delete_multiple_device_profile_by_names,
'fake_device_name1', 'fake_device_name2')
@test.attr(type=['negative', 'gate'])
@decorators.attr(type=['negative', 'gate'])
def test_delete_device_profile_name_null(self):
# delete the device_profile name is null
name = ""
@ -65,7 +65,7 @@ class DeviceProfileNegativeTest(base.BaseAPITest):
self.os_admin.cyborg_client.delete_device_profile,
name)
@test.attr(type=['negative', 'gate'])
@decorators.attr(type=['negative', 'gate'])
def test_create_device_profile_server_fault(self):
# create device profile using an existing dp uuid
dp = [{
@ -89,7 +89,7 @@ class DeviceProfileNegativeTest(base.BaseAPITest):
self.os_admin.cyborg_client.create_device_profile,
dp)
@test.attr(type=['negative', 'gate'])
@decorators.attr(type=['negative', 'gate'])
def test_create_device_profile_conflict(self):
# create device profile name same
dp = [{
@ -112,7 +112,7 @@ class DeviceProfileNegativeTest(base.BaseAPITest):
self.os_admin.cyborg_client.create_device_profile,
dp)
@test.attr(type=['negative', 'gate'])
@decorators.attr(type=['negative', 'gate'])
def test_create_device_profile_name_is_null(self):
# create device profile name is null
dp = [{
@ -130,7 +130,7 @@ class DeviceProfileNegativeTest(base.BaseAPITest):
self.os_admin.cyborg_client.create_device_profile,
dp)
@test.attr(type=['negative', 'gate'])
@decorators.attr(type=['negative', 'gate'])
def test_create_device_profile_name_to_long(self):
# create device profile name character is too long
name_value = "".join(random.sample(