Here are the examples of the python api mock.call.remove_interface_router taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
0
Example 1
Project: ec2-api Source File: test_subnet.py
@tools.screen_unexpected_exception_logs
def test_create_subnet_rollback(self):
self.set_mock_db_items(fakes.DB_VPC_1, fakes.DB_ROUTE_TABLE_1)
self.db_api.add_item.side_effect = (
tools.get_db_api_add_item(fakes.ID_EC2_SUBNET_1))
self.neutron.create_network.side_effect = (
tools.get_neutron_create('network', fakes.ID_OS_NETWORK_1,
{'status': 'available'}))
self.neutron.create_subnet.side_effect = (
tools.get_neutron_create('subnet', fakes.ID_OS_SUBNET_1))
self.neutron.update_network.side_effect = Exception()
self.assert_execution_error(self.ANY_EXECUTE_ERROR, 'CreateSubnet',
{'VpcId': fakes.ID_EC2_VPC_1,
'CidrBlock': fakes.CIDR_SUBNET_1})
self.neutron.assert_has_calls([
mock.call.remove_interface_router(
fakes.ID_OS_ROUTER_1, {'subnet_id': fakes.ID_OS_SUBNET_1}),
mock.call.delete_subnet(fakes.ID_OS_SUBNET_1),
mock.call.delete_network(fakes.ID_OS_NETWORK_1)])
self.db_api.delete_item.assert_called_once_with(
mock.ANY, fakes.ID_EC2_SUBNET_1)