matrix42: use a pattern for ddname on fragment endpoint (#83105)
gitea/passerelle/pipeline/head Build queued...
Details
gitea/passerelle/pipeline/head Build queued...
Details
This commit is contained in:
parent
264550e363
commit
2162e9d08d
|
@ -93,12 +93,13 @@ class Matrix42(BaseResource, HTTPResource):
|
|||
|
||||
@endpoint(
|
||||
name='fragment',
|
||||
pattern=r'^(?P<ddname>.+)$',
|
||||
example_pattern='SPSUserClassBase',
|
||||
description=_('Fragment Query'),
|
||||
display_category=_('Fragments'),
|
||||
parameters={
|
||||
'ddname': {
|
||||
'description': _('Technical name of the Data Definition'),
|
||||
'example_value': 'SPSUserClassBase',
|
||||
},
|
||||
'columns': {
|
||||
'description': _('Columns in the result set, separated by comma'),
|
||||
|
|
|
@ -33,8 +33,9 @@ def matrix42():
|
|||
def test_matrix42_fragment(mocked_request, app, matrix42):
|
||||
endpoint = generic_endpoint_url('matrix42', 'fragment', slug=matrix42.slug)
|
||||
assert endpoint == '/matrix42/test/fragment'
|
||||
endpoint += '/SPSUserClassBase'
|
||||
|
||||
params = {'ddname': 'SPSUserClassBase'}
|
||||
params = {}
|
||||
mocked_request.side_effect = [
|
||||
FakedResponse(content=TOKEN, status_code=200),
|
||||
FakedResponse(content=USERS, status_code=200),
|
||||
|
@ -154,7 +155,8 @@ def test_matrix42_fragment(mocked_request, app, matrix42):
|
|||
@mock.patch('passerelle.utils.Request.request')
|
||||
def test_matrix42_bad_rawtoken(mocked_request, app, matrix42):
|
||||
endpoint = generic_endpoint_url('matrix42', 'fragment', slug=matrix42.slug)
|
||||
params = {'ddname': 'SPSUserClassBase'}
|
||||
endpoint += '/SPSUserClassBase'
|
||||
params = {}
|
||||
# open access
|
||||
api = ApiUser.objects.create(username='all', keytype='', key='')
|
||||
obj_type = ContentType.objects.get_for_model(matrix42)
|
||||
|
|
Loading…
Reference in New Issue