forked from mtusi2026/mtusi2026lab2
fix problems
This commit is contained in:
@@ -42,6 +42,14 @@ def main():
|
||||
bob = c.user("grade4_bob")
|
||||
|
||||
# Basic is only for login; business endpoints require the returned Bearer token.
|
||||
c.call("POST", "/api/v1/users", 400, body={
|
||||
"username": "spaces_" + uuid.uuid4().hex[:16],
|
||||
"display_name": "Whitespace",
|
||||
"password": "\u0085" * 12,
|
||||
})
|
||||
c.call("POST", "/api/v1/auth/sessions", 400,
|
||||
headers={**basic(alice["registration"]["username"], alice["registration"]["password"]),
|
||||
"Content-Type": "application/json"}, raw=b"{}")
|
||||
wrong = c.call("POST", "/api/v1/auth/sessions", 401,
|
||||
headers=basic(alice["registration"]["username"], "wrong-password-123"))
|
||||
check(wrong["headers"].get("WWW-Authenticate", "").startswith("Basic"),
|
||||
|
||||
Reference in New Issue
Block a user