'Convenient method to test network_list_for_tenant.
:param include_external: Passed to network_list_for_tenant.
:param filter_params: Filters passed to network_list_for_tenant
:param should_called: this argument specifies which methods
should be called. Methods in this list should be called.
Valid values are non_shared, shared, and external.'

@test.create_stubs({api.neutron: ('network_list', 'subnet_list')})
def _test_network_list_for_tenant(self, include_external, filter_params, should_called):

    filter_params = (filter_params or {})
    all_networks = self.networks.list()
    tenant_id = '1'
    if ('non_shared' in should_called):
        params = filter_params.copy()
        params['shared'] = False
        api.neutron.network_list(IsA(http.HttpRequest), tenant_id=tenant_id, **params).AndReturn([network for network in all_networks if (network['tenant_id'] == tenant_id)])
    if ('shared' in should_called):
        params = filter_params.copy()
        params['shared'] = True
        api.neutron.network_list(IsA(http.HttpRequest), **params).AndReturn([network for network in all_networks if network.get('shared')])
    if ('external' in should_called):
        params = filter_params.copy()
        params['router:external'] = True
        api.neutron.network_list(IsA(http.HttpRequest), **params).AndReturn([network for network in all_networks if network.get('router:external')])
    self.mox.ReplayAll()
    ret_val = api.neutron.network_list_for_tenant(self.request, tenant_id, include_external=include_external, **filter_params)
    expected = [n for n in all_networks if ((('non_shared' in should_called) and (n['tenant_id'] == tenant_id)) or (('shared' in should_called) and n['shared']) or (('external' in should_called) and include_external and n['router:external']))]
    self.assertEqual(set((n.id for n in expected)), set((n.id for n in ret_val)))
