Negative tests added for network
Here some negative tests added
for network:-
*For a non existent network id
*For a non existent subnet id
Change-Id: I81a72853e4b9cfde63e5dbea37e743e7a90ca00c
diff --git a/tempest/api/network/test_networks.py b/tempest/api/network/test_networks.py
index 36715a0..de4f746 100644
--- a/tempest/api/network/test_networks.py
+++ b/tempest/api/network/test_networks.py
@@ -116,3 +116,15 @@
subnets = body['subnets']
found = any(n for n in subnets if n['id'] == self.subnet['id'])
self.assertTrue(found)
+
+ @attr(type=['negative', 'gate'])
+ def test_show_non_existent_network(self):
+ non_exist_id = rand_name('network')
+ self.assertRaises(exceptions.NotFound, self.client.show_network,
+ non_exist_id)
+
+ @attr(type=['negative', 'gate'])
+ def test_show_non_existent_subnet(self):
+ non_exist_id = rand_name('subnet')
+ self.assertRaises(exceptions.NotFound, self.client.show_subnet,
+ non_exist_id)