This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test the endpoint does actually return 400
- Loading branch information
David Robertson
committed
Jun 14, 2022
1 parent
a9ca641
commit 4bd6b73
Showing
1 changed file
with
6 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
# limitations under the License. | ||
|
||
"""Tests REST events for /profile paths.""" | ||
from http import HTTPStatus | ||
from typing import Any, Dict, Optional | ||
|
||
from twisted.test.proto_helpers import MemoryReactor | ||
|
@@ -49,6 +50,11 @@ def test_get_displayname(self) -> None: | |
res = self._get_displayname() | ||
self.assertEqual(res, "owner") | ||
|
||
def test_get_displayname_rejects_bad_username(self) -> None: | ||
# Note: probably ought to urlencode the userid here, since it contains an `@` | ||
channel = self.make_request("GET", f"/profile/[email protected]/displayname") | ||
self.assertEqual(channel.code, HTTPStatus.BAD_REQUEST, channel.result) | ||
|
||
def test_set_displayname(self) -> None: | ||
channel = self.make_request( | ||
"PUT", | ||
|