Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • briar/python-briar-wrapper
1 result
Show changes
Commits on Source (3)
...@@ -15,4 +15,4 @@ The source code can be found on ...@@ -15,4 +15,4 @@ The source code can be found on
[code.briarproject.org](https://code.briarproject.org/briar/python-briar-wrapper). [code.briarproject.org](https://code.briarproject.org/briar/python-briar-wrapper).
""" """
__version__ = "0.0.5" __version__ = "0.0.6"
...@@ -12,6 +12,7 @@ from urllib.parse import urljoin ...@@ -12,6 +12,7 @@ from urllib.parse import urljoin
from requests import delete as _delete from requests import delete as _delete
from requests import get as _get from requests import get as _get
from requests import post as _post from requests import post as _post
from requests import put as _put
from briar_wrapper.constants import BASE_HTTP_URL from briar_wrapper.constants import BASE_HTTP_URL
from briar_wrapper.model import Model from briar_wrapper.model import Model
...@@ -42,11 +43,11 @@ class Contacts(Model): ...@@ -42,11 +43,11 @@ class Contacts(Model):
""" """
Sets the alias of a given user Sets the alias of a given user
[Upstream documentation](https://code.briarproject.org/briar/briar/-/blob/main/briar-headless/README.md#changing-alias-of-a-contact) [Upstream documentation](https://code.briarproject.org/briar/briar/-/blob/master/briar-headless/README.md#changing-alias-of-a-contact)
""" """
url = urljoin(BASE_HTTP_URL, self._API_ENDPOINT + f"{str(contact_id)}/alias") url = urljoin(BASE_HTTP_URL, self._API_ENDPOINT + f"{str(contact_id)}/alias")
_post(url, headers=self._headers, json={"alias": alias}) _put(url, headers=self._headers, json={"alias": alias})
def delete(self, contact_id: int) -> None: def delete(self, contact_id: int) -> None:
# pylint: disable=line-too-long # pylint: disable=line-too-long
......
python-briar-wrapper (0.0.6-1) UNRELEASED; urgency=medium
* Fix support for changing contact alias
-- Nico Alt <nicoalt@posteo.org> Wed, 14 Oct 2020 17:25:32 +0000
python-briar-wrapper (0.0.5-1) UNRELEASED; urgency=medium python-briar-wrapper (0.0.5-1) UNRELEASED; urgency=medium
* Allow to mark messages as read * Allow to mark messages as read
......
...@@ -54,7 +54,7 @@ def match_request_add_pending(request): ...@@ -54,7 +54,7 @@ def match_request_add_pending(request):
def test_set_alias(api, request_headers, requests_mock): def test_set_alias(api, request_headers, requests_mock):
contacts = Contacts(api) contacts = Contacts(api)
contact_id = 137 contact_id = 137
requests_mock.register_uri("POST", requests_mock.register_uri("PUT",
BASE_HTTP_URL + f"{contact_id}/alias", BASE_HTTP_URL + f"{contact_id}/alias",
request_headers=request_headers, request_headers=request_headers,
additional_matcher=match_request_set_alias) additional_matcher=match_request_set_alias)
......