author | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> |
Thu, 14 Apr 2011 14:19:21 +0200 | |
branch | stable |
changeset 7224 | e5833657c646 |
parent 6851 | 824d5b6eae7f |
child 7232 | 506a0af77cee |
permissions | -rw-r--r-- |
5421
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4850
diff
changeset
|
1 |
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4850
diff
changeset
|
2 |
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4850
diff
changeset
|
3 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4850
diff
changeset
|
4 |
# This file is part of CubicWeb. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4850
diff
changeset
|
5 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4850
diff
changeset
|
6 |
# CubicWeb is free software: you can redistribute it and/or modify it under the |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4850
diff
changeset
|
7 |
# terms of the GNU Lesser General Public License as published by the Free |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4850
diff
changeset
|
8 |
# Software Foundation, either version 2.1 of the License, or (at your option) |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4850
diff
changeset
|
9 |
# any later version. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4850
diff
changeset
|
10 |
# |
5424
8ecbcbff9777
replace logilab-common by CubicWeb in disclaimer
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5421
diff
changeset
|
11 |
# CubicWeb is distributed in the hope that it will be useful, but WITHOUT |
5421
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4850
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4850
diff
changeset
|
13 |
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4850
diff
changeset
|
14 |
# details. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4850
diff
changeset
|
15 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4850
diff
changeset
|
16 |
# You should have received a copy of the GNU Lesser General Public License along |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4850
diff
changeset
|
17 |
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
0 | 18 |
"""Fake objects to ease testing of cubicweb without a fully working environment |
5768
1e73a466aa69
[fti] support for fti ranking: has_text query results sorted by relevance, and provides a way to control weight per entity / entity's attribute
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5467
diff
changeset
|
19 |
""" |
0 | 20 |
|
21 |
__docformat__ = "restructuredtext en" |
|
22 |
||
4848
41f84eea63c9
rename logilab.db into logilab.database
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4835
diff
changeset
|
23 |
from logilab.database import get_db_helper |
0 | 24 |
|
2792
135580d15d42
rename and move cw.RequestSessionMixIn to cw.req.RequestSessionBase; move some appobjects methods where they actually belong to
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2773
diff
changeset
|
25 |
from cubicweb.req import RequestSessionBase |
3240
8604a15995d1
refactor so that rql rewriter may be used outside the server. Enhance it to be usable for RRQLExpression as well
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2703
diff
changeset
|
26 |
from cubicweb.cwvreg import CubicWebVRegistry |
0 | 27 |
from cubicweb.web.request import CubicWebRequestBase |
7224
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
28 |
from cubicweb.web.http_headers import Headers |
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
29 |
|
0 | 30 |
from cubicweb.devtools import BASE_URL, BaseApptestConfiguration |
31 |
||
32 |
||
33 |
class FakeConfig(dict, BaseApptestConfiguration): |
|
34 |
translations = {} |
|
5467
57372dbfd114
[https] fix resource urls in https version of a site: should use the https version as well to avoid warnings from the nrowser
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5444
diff
changeset
|
35 |
uiprops = {} |
0 | 36 |
apphome = None |
37 |
def __init__(self, appid='data', apphome=None, cubes=()): |
|
38 |
self.appid = appid |
|
39 |
self.apphome = apphome |
|
40 |
self._cubes = cubes |
|
41 |
self['auth-mode'] = 'cookie' |
|
1482 | 42 |
self['uid'] = None |
0 | 43 |
self['base-url'] = BASE_URL |
44 |
self['rql-cache-size'] = 100 |
|
5444
f7fdb5dd82f6
[webconfig] introduce property sheets. Use them to replace external_resources
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5443
diff
changeset
|
45 |
self.datadir_url = BASE_URL + 'data/' |
1482 | 46 |
|
0 | 47 |
def cubes(self, expand=False): |
48 |
return self._cubes |
|
1482 | 49 |
|
0 | 50 |
def sources(self): |
5768
1e73a466aa69
[fti] support for fti ranking: has_text query results sorted by relevance, and provides a way to control weight per entity / entity's attribute
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5467
diff
changeset
|
51 |
return {'system': {'db-driver': 'sqlite'}} |
0 | 52 |
|
53 |
||
54 |
class FakeRequest(CubicWebRequestBase): |
|
55 |
"""test implementation of an cubicweb request object""" |
|
56 |
||
57 |
def __init__(self, *args, **kwargs): |
|
58 |
if not (args or 'vreg' in kwargs): |
|
3240
8604a15995d1
refactor so that rql rewriter may be used outside the server. Enhance it to be usable for RRQLExpression as well
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2703
diff
changeset
|
59 |
kwargs['vreg'] = CubicWebVRegistry(FakeConfig(), initlog=False) |
0 | 60 |
kwargs['https'] = False |
61 |
self._url = kwargs.pop('url', 'view?rql=Blop&vid=blop') |
|
62 |
super(FakeRequest, self).__init__(*args, **kwargs) |
|
63 |
self._session_data = {} |
|
7224
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
64 |
self._headers_in = Headers() |
0 | 65 |
|
7224
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
66 |
def set_cookie(self, cookie, key, maxage=300, expires=None): |
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
67 |
super(FakeRequest, self).set_cookie(cookie, key, maxage=300, expires=None) |
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
68 |
cookie = self.get_response_header('Set-Cookie') |
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
69 |
self._headers_in.setHeader('Cookie', cookie) |
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
70 |
|
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
71 |
## Implement request abstract API |
0 | 72 |
def header_accept_language(self): |
73 |
"""returns an ordered list of preferred languages""" |
|
74 |
return ('en',) |
|
75 |
||
76 |
def header_if_modified_since(self): |
|
77 |
return None |
|
78 |
||
79 |
def relative_path(self, includeparams=True): |
|
80 |
"""return the normalized path of the request (ie at least relative |
|
2476
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2471
diff
changeset
|
81 |
to the instance's root, but some other normalization may be needed |
0 | 82 |
so that the returned path may be used to compare to generated urls |
83 |
""" |
|
84 |
if self._url.startswith(BASE_URL): |
|
85 |
url = self._url[len(BASE_URL):] |
|
86 |
else: |
|
87 |
url = self._url |
|
88 |
if includeparams: |
|
89 |
return url |
|
90 |
return url.split('?', 1)[0] |
|
91 |
||
7224
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
92 |
def get_header(self, header, default=None, raw=True): |
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
93 |
"""return the value associated with the given input header, raise |
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
94 |
KeyError if the header is not set |
0 | 95 |
""" |
7224
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
96 |
if raw: |
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
97 |
return self._headers_in.getRawHeaders(header, [default])[0] |
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
98 |
return self._headers_in.getHeader(header, default) |
1482 | 99 |
|
7224
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
100 |
## extend request API to control headers in / out values |
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
101 |
def set_request_header(self, header, value, raw=False): |
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
102 |
"""set an input HTTP header""" |
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
103 |
if isinstance(value, basestring): |
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
104 |
value = [value] |
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
105 |
if raw: |
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
106 |
self._headers_in.setRawHeaders(header, value) |
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
107 |
else: |
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
108 |
self._headers_in.setHeader(header, value) |
1482 | 109 |
|
7224
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
110 |
def get_response_header(self, header, default=None, raw=False): |
0 | 111 |
"""return the value associated with the given input header, |
112 |
raise KeyError if the header is not set |
|
113 |
""" |
|
7224
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
114 |
if raw: |
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
115 |
return self.headers_out.getRawHeaders(header, default) |
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
116 |
else: |
e5833657c646
[testlib] make a clear distinction between input / output HTTP headers
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
6851
diff
changeset
|
117 |
return self.headers_out.getHeader(header, default) |
0 | 118 |
|
119 |
def validate_cache(self): |
|
120 |
pass |
|
121 |
||
6595
00cd0b273cf5
[test] fix test to follow recent changes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6427
diff
changeset
|
122 |
def build_url_params(self, **kwargs): |
00cd0b273cf5
[test] fix test to follow recent changes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6427
diff
changeset
|
123 |
# overriden to get predictable resultts |
00cd0b273cf5
[test] fix test to follow recent changes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6427
diff
changeset
|
124 |
args = [] |
00cd0b273cf5
[test] fix test to follow recent changes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6427
diff
changeset
|
125 |
for param, values in sorted(kwargs.iteritems()): |
00cd0b273cf5
[test] fix test to follow recent changes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6427
diff
changeset
|
126 |
if not isinstance(values, (list, tuple)): |
00cd0b273cf5
[test] fix test to follow recent changes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6427
diff
changeset
|
127 |
values = (values,) |
00cd0b273cf5
[test] fix test to follow recent changes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6427
diff
changeset
|
128 |
for value in values: |
00cd0b273cf5
[test] fix test to follow recent changes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6427
diff
changeset
|
129 |
assert value is not None |
00cd0b273cf5
[test] fix test to follow recent changes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6427
diff
changeset
|
130 |
args.append(u'%s=%s' % (param, self.url_quote(value))) |
00cd0b273cf5
[test] fix test to follow recent changes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6427
diff
changeset
|
131 |
return '&'.join(args) |
0 | 132 |
|
133 |
class FakeUser(object): |
|
134 |
login = 'toto' |
|
135 |
eid = 0 |
|
136 |
def in_groups(self, groups): |
|
137 |
return True |
|
138 |
||
139 |
||
2792
135580d15d42
rename and move cw.RequestSessionMixIn to cw.req.RequestSessionBase; move some appobjects methods where they actually belong to
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2773
diff
changeset
|
140 |
class FakeSession(RequestSessionBase): |
4835
13b0b96d7982
[repo] enhanced security handling: deprecates unsafe_execute, in favor of explicit read/write security control using the `enabled_security` context manager. Also code executed on the repository side is now unsafe by default.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4831
diff
changeset
|
141 |
read_security = write_security = True |
13b0b96d7982
[repo] enhanced security handling: deprecates unsafe_execute, in favor of explicit read/write security control using the `enabled_security` context manager. Also code executed on the repository side is now unsafe by default.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4831
diff
changeset
|
142 |
set_read_security = set_write_security = lambda *args, **kwargs: None |
13b0b96d7982
[repo] enhanced security handling: deprecates unsafe_execute, in favor of explicit read/write security control using the `enabled_security` context manager. Also code executed on the repository side is now unsafe by default.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4831
diff
changeset
|
143 |
|
0 | 144 |
def __init__(self, repo=None, user=None): |
145 |
self.repo = repo |
|
3240
8604a15995d1
refactor so that rql rewriter may be used outside the server. Enhance it to be usable for RRQLExpression as well
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2703
diff
changeset
|
146 |
self.vreg = getattr(self.repo, 'vreg', CubicWebVRegistry(FakeConfig(), initlog=False)) |
0 | 147 |
self.pool = FakePool() |
148 |
self.user = user or FakeUser() |
|
149 |
self.is_internal_session = False |
|
2101
08003e0354a7
update transaction data api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
150 |
self.transaction_data = {} |
1482 | 151 |
|
4835
13b0b96d7982
[repo] enhanced security handling: deprecates unsafe_execute, in favor of explicit read/write security control using the `enabled_security` context manager. Also code executed on the repository side is now unsafe by default.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4831
diff
changeset
|
152 |
def execute(self, *args, **kwargs): |
0 | 153 |
pass |
2703
27c04321fc81
[cleanup] delete-trailing-whitespace + removed debug print
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
2650
diff
changeset
|
154 |
|
0 | 155 |
def commit(self, *args): |
2101
08003e0354a7
update transaction data api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
156 |
self.transaction_data.clear() |
0 | 157 |
def close(self, *args): |
158 |
pass |
|
159 |
def system_sql(self, sql, args=None): |
|
160 |
pass |
|
161 |
||
162 |
def set_entity_cache(self, entity): |
|
163 |
pass |
|
1482 | 164 |
|
0 | 165 |
class FakeRepo(object): |
166 |
querier = None |
|
167 |
def __init__(self, schema, vreg=None, config=None): |
|
168 |
self.extids = {} |
|
169 |
self.eids = {} |
|
170 |
self._count = 0 |
|
171 |
self.schema = schema |
|
172 |
self.config = config or FakeConfig() |
|
3240
8604a15995d1
refactor so that rql rewriter may be used outside the server. Enhance it to be usable for RRQLExpression as well
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2703
diff
changeset
|
173 |
self.vreg = vreg or CubicWebVRegistry(self.config, initlog=False) |
8604a15995d1
refactor so that rql rewriter may be used outside the server. Enhance it to be usable for RRQLExpression as well
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2703
diff
changeset
|
174 |
self.vreg.schema = schema |
6427
c8a5ac2d1eaa
[schema / sources] store data sources as cubicweb entities
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5768
diff
changeset
|
175 |
self.sources = [] |
0 | 176 |
|
177 |
def internal_session(self): |
|
178 |
return FakeSession(self) |
|
1481 | 179 |
|
6851
824d5b6eae7f
[repo] kill no more needed 'recreate' feature
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6595
diff
changeset
|
180 |
def extid2eid(self, source, extid, etype, session, insert=True): |
0 | 181 |
try: |
182 |
return self.extids[extid] |
|
183 |
except KeyError: |
|
184 |
if not insert: |
|
185 |
return None |
|
186 |
self._count += 1 |
|
187 |
eid = self._count |
|
188 |
entity = source.before_entity_insertion(session, extid, etype, eid) |
|
189 |
self.extids[extid] = eid |
|
190 |
self.eids[eid] = extid |
|
191 |
source.after_entity_insertion(session, extid, entity) |
|
192 |
return eid |
|
1482 | 193 |
|
0 | 194 |
def eid2extid(self, source, eid, session=None): |
195 |
return self.eids[eid] |
|
196 |
||
197 |
||
198 |
class FakeSource(object): |
|
4831
c5aec27c1bf7
[repo] use logilab.db instead of lgc.adbh/lgc.db/lgc.sqlgen/indexer, test new date extranction functions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4459
diff
changeset
|
199 |
dbhelper = get_db_helper('sqlite') |
0 | 200 |
def __init__(self, uri): |
201 |
self.uri = uri |
|
202 |
||
1482 | 203 |
|
0 | 204 |
class FakePool(object): |
205 |
def source(self, uri): |
|
206 |
return FakeSource(uri) |