def test_create_router_failure(self):
router_info = copy.deepcopy(fake_router_object)
router_info['router'].update({'status': 'ACTIVE',
'id': fake_router_uuid})
context = mock.Mock(current=fake_router_object)
response = self._create_rest_response(requests.codes.bad_gateway)
with mock.patch.object(ac_rest.RestClient, 'process_request',
return_value=response):
with mock.patch.object(L3_NAT_db_mixin,
'create_router',
return_value=fake_router_db):
acl3router = HuaweiACL3RouterPlugin()
self.assertRaises(ml2_exc.MechanismDriverError,
acl3router.create_router,
context, router_info)
评论列表
文章目录