Add "test_delete_agent_negative"

In [0], "AgentManagementTestJSON" was removed from tempest to avoid
duplications with this repository, but "test_delete_agent_negative"
was missing.

[0] https://review.opendev.org/#/c/698589/

Change-Id: I2a6e0f958dac8fb41bdd709e7b595e256b84ed03
Related-Bug: #1855985
This commit is contained in:
Rodolfo Alonso Hernandez 2019-12-16 11:51:08 +00:00
parent 1cf724f7d7
commit 7d70482b10

View File

@ -13,7 +13,9 @@
# under the License.
from neutron_tempest_plugin.common import tempest_fixtures
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from neutron_tempest_plugin.api import base
@ -90,3 +92,10 @@ class AgentManagementTestJSON(base.BaseAdminNetworkTest):
if self.agent['id'] != agent['id']:
return agent
raise self.skipException("This test requires at least two agents.")
@decorators.idempotent_id('b33af888-b6ac-4e68-a0ca-0444c2696cf9')
def test_delete_agent_negative(self):
non_existent_id = data_utils.rand_uuid()
self.assertRaises(
lib_exc.NotFound,
self.admin_client.delete_agent, non_existent_id)