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
This commit is contained in:
Anju Tiwari 2013-08-03 05:43:42 +05:30
parent 1702f21983
commit 6656f58726
1 changed files with 12 additions and 0 deletions

View File

@ -116,3 +116,15 @@ class NetworksTest(base.BaseNetworkTest):
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)