'Basic test that the right query is called'

def test__get_subnets_by_network(self):

    context = mock.MagicMock()
    query = context.session.query().outerjoin().filter()
    query.__iter__.return_value = [(mock.sentinel.subnet_db, mock.sentinel.address_scope_id)]
    with mock.patch.object(directory, 'get_plugin') as get_p:
        get_p()._make_subnet_dict.return_value = {'network_id': mock.sentinel.network_id}
        subnets = self.db._get_subnets_by_network_list(context, [mock.sentinel.network_id])
    self.assertEqual({mock.sentinel.network_id: [{'address_scope_id': mock.sentinel.address_scope_id, 'network_id': mock.sentinel.network_id}]}, subnets)
