Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Python Briar Wrapper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
briar
Python Briar Wrapper
Commits
843b7dbc
Commit
843b7dbc
authored
4 years ago
by
Jan Luttermann
Browse files
Options
Downloads
Patches
Plain Diff
fix: changed post to put for changing alias
Closes:
!16
parent
2cdcb321
No related branches found
No related tags found
1 merge request
!18
fix: changed post to put for changing alias
Pipeline
#5004
passed
4 years ago
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
briar_wrapper/models/contacts.py
+2
-1
2 additions, 1 deletion
briar_wrapper/models/contacts.py
tests/briar_wrapper/models/test_contacts.py
+1
-1
1 addition, 1 deletion
tests/briar_wrapper/models/test_contacts.py
with
3 additions
and
2 deletions
briar_wrapper/models/contacts.py
+
2
−
1
View file @
843b7dbc
...
...
@@ -12,6 +12,7 @@ from urllib.parse import urljoin
from
requests
import
delete
as
_delete
from
requests
import
get
as
_get
from
requests
import
post
as
_post
from
requests
import
put
as
_put
from
briar_wrapper.constants
import
BASE_HTTP_URL
from
briar_wrapper.model
import
Model
...
...
@@ -46,7 +47,7 @@ class Contacts(Model):
"""
url
=
urljoin
(
BASE_HTTP_URL
,
self
.
_API_ENDPOINT
+
f
"
{
str
(
contact_id
)
}
/alias
"
)
_p
os
t
(
url
,
headers
=
self
.
_headers
,
json
=
{
"
alias
"
:
alias
})
_p
u
t
(
url
,
headers
=
self
.
_headers
,
json
=
{
"
alias
"
:
alias
})
def
delete
(
self
,
contact_id
:
int
)
->
None
:
# pylint: disable=line-too-long
...
...
This diff is collapsed.
Click to expand it.
tests/briar_wrapper/models/test_contacts.py
+
1
−
1
View file @
843b7dbc
...
...
@@ -54,7 +54,7 @@ def match_request_add_pending(request):
def
test_set_alias
(
api
,
request_headers
,
requests_mock
):
contacts
=
Contacts
(
api
)
contact_id
=
137
requests_mock
.
register_uri
(
"
P
OS
T
"
,
requests_mock
.
register_uri
(
"
P
U
T
"
,
BASE_HTTP_URL
+
f
"
{
contact_id
}
/alias
"
,
request_headers
=
request_headers
,
additional_matcher
=
match_request_set_alias
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment