Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
retribute.me
api
Commits
074fdd51
Verified
Commit
074fdd51
authored
Jun 06, 2019
by
Eliot Berriot
Browse files
Removed /api in paths
parent
cf0aee3d
Changes
2
Hide whitespace changes
Inline
Side-by-side
config/routing.py
View file @
074fdd51
...
...
@@ -18,9 +18,9 @@ application = ProtocolTypeRouter(
{
"http"
:
URLRouter
(
[
url
(
r
"^
api/
v1/search/$"
,
consumers
.
SearchMultipleConsumer
),
url
(
r
"^v1/search/$"
,
consumers
.
SearchMultipleConsumer
),
url
(
r
"^
api/
v1/search/(?P<lookup_type>.+):(?P<lookup>.+)$"
,
r
"^v1/search/(?P<lookup_type>.+):(?P<lookup>.+)$"
,
consumers
.
SearchSingleConsumer
,
),
url
(
r
""
,
AsgiHandler
),
...
...
tests/search/test_consumers.py
View file @
074fdd51
...
...
@@ -16,7 +16,7 @@ async def test_search_consumer_success(
sources
,
"result_to_retribute_profile"
,
return_value
=
expected
)
communicator
=
HttpCommunicator
(
application
,
"GET"
,
"/
api/
v1/search/webfinger:test@user.domain"
application
,
"GET"
,
"/v1/search/webfinger:test@user.domain"
)
response
=
await
communicator
.
get_response
()
assert
get
.
call_args
[
0
][
0
]
==
"test@user.domain"
...
...
@@ -59,7 +59,7 @@ async def test_search_multiple(loop, application, mocker, coroutine_mock, dummyc
)
query
=
{
"lookups"
:
[
"webfinger:1"
,
"webfinger:2"
,
"webfinger:3"
,
"webfinger:4"
]}
communicator
=
HttpCommunicator
(
application
,
"POST"
,
"/
api/
v1/search/"
,
body
=
json
.
dumps
(
query
).
encode
()
application
,
"POST"
,
"/v1/search/"
,
body
=
json
.
dumps
(
query
).
encode
()
)
response
=
await
communicator
.
get_response
()
assert
response
[
"status"
]
==
200
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment