'Makes sure flat_interface flag overrides network bridge_interface.
Allows heterogeneous networks a la bug 833426'

@mock.patch.object(linux_net.LinuxBridgeInterfaceDriver, 'ensure_bridge')
def test_flat_override(self, mock_ensure_bridge):

    driver = linux_net.LinuxBridgeInterfaceDriver()
    info = {}
    def test_ensure(bridge, interface, network, gateway):
        info['passed_interface'] = interface
    mock_ensure_bridge.side_effect = test_ensure
    network = {'bridge': 'br100', 'bridge_interface': 'base_interface', 'share_address': False}
    driver.plug(network, 'fakemac')
    self.assertEqual('base_interface', info['passed_interface'])
    self.flags(flat_interface='override_interface')
    driver.plug(network, 'fakemac')
    self.assertEqual('override_interface', info['passed_interface'])
    self.assertEqual(2, mock_ensure_bridge.call_count)
