@@ -6323,6 +6323,7 @@ def test_get_segment_ids_for_network_passes(self, mock_client):
6323
6323
res = self .api .get_segment_ids_for_network (
6324
6324
self .context , uuids .network_id )
6325
6325
self .assertEqual ([uuids .segment_id ], res )
6326
+ mock_client .assert_called_once_with (self .context , admin = True )
6326
6327
mocked_client .list_subnets .assert_called_once_with (
6327
6328
network_id = uuids .network_id , fields = 'segment_id' )
6328
6329
@@ -6338,6 +6339,7 @@ def test_get_segment_ids_for_network_with_no_segments(self, mock_client):
6338
6339
res = self .api .get_segment_ids_for_network (
6339
6340
self .context , uuids .network_id )
6340
6341
self .assertEqual ([], res )
6342
+ mock_client .assert_called_once_with (self .context , admin = True )
6341
6343
mocked_client .list_subnets .assert_called_once_with (
6342
6344
network_id = uuids .network_id , fields = 'segment_id' )
6343
6345
@@ -6353,6 +6355,7 @@ def test_get_segment_ids_for_network_fails(self, mock_client):
6353
6355
self .assertRaises (exception .InvalidRoutedNetworkConfiguration ,
6354
6356
self .api .get_segment_ids_for_network ,
6355
6357
self .context , uuids .network_id )
6358
+ mock_client .assert_called_once_with (self .context , admin = True )
6356
6359
6357
6360
def test_get_segment_id_for_subnet_no_segment_ext (self ):
6358
6361
with mock .patch .object (
@@ -6374,6 +6377,7 @@ def test_get_segment_id_for_subnet_passes(self, mock_client):
6374
6377
res = self .api .get_segment_id_for_subnet (
6375
6378
self .context , uuids .subnet_id )
6376
6379
self .assertEqual (uuids .segment_id , res )
6380
+ mock_client .assert_called_once_with (self .context , admin = True )
6377
6381
mocked_client .show_subnet .assert_called_once_with (uuids .subnet_id )
6378
6382
6379
6383
@mock .patch .object (neutronapi , 'get_client' )
@@ -6388,6 +6392,7 @@ def test_get_segment_id_for_subnet_with_no_segment(self, mock_client):
6388
6392
self .assertIsNone (
6389
6393
self .api .get_segment_id_for_subnet (self .context ,
6390
6394
uuids .subnet_id ))
6395
+ mock_client .assert_called_once_with (self .context , admin = True )
6391
6396
6392
6397
@mock .patch .object (neutronapi , 'get_client' )
6393
6398
def test_get_segment_id_for_subnet_fails (self , mock_client ):
@@ -6401,6 +6406,7 @@ def test_get_segment_id_for_subnet_fails(self, mock_client):
6401
6406
self .assertRaises (exception .InvalidRoutedNetworkConfiguration ,
6402
6407
self .api .get_segment_id_for_subnet ,
6403
6408
self .context , uuids .subnet_id )
6409
+ mock_client .assert_called_once_with (self .context , admin = True )
6404
6410
6405
6411
@mock .patch .object (neutronapi .LOG , 'debug' )
6406
6412
def test_get_port_pci_slot (self , mock_debug ):
0 commit comments