API workers share startup and OAuth sign-ins through the data folder
This commit is contained in:
@@ -106,7 +106,7 @@ def test_a_sign_in_button_without_an_app_registration_says_who_must_register_one
|
||||
assert found.status_code == 503 and "GOOGLE_CLIENT_ID" in found.json()["detail"]
|
||||
|
||||
|
||||
def test_signing_in_hands_the_account_to_the_dialog(client, monkeypatch):
|
||||
def test_signing_in_hands_the_account_to_the_dialog(client, monkeypatch, tmp_path):
|
||||
from authlib.integrations.httpx_client import OAuth2Client, oauth2_client
|
||||
|
||||
httpx = oauth2_client.httpx2 # the HTTP library this authlib is built on
|
||||
@@ -126,6 +126,7 @@ def test_signing_in_hands_the_account_to_the_dialog(client, monkeypatch):
|
||||
transport=httpx.MockTransport(provider)) # fmt: skip
|
||||
|
||||
monkeypatch.setattr(sources, "_client", client_for)
|
||||
monkeypatch.setattr(sources, "PENDING", tmp_path / "pending") # any worker's callback
|
||||
monkeypatch.setattr(sources, "account", lambda p, token, env: {
|
||||
"user": "ana@hospital.mx", "drive_id": "d1",
|
||||
"oauth2_client_params": {"client_id": env["client_id"], "token": token}}) # fmt: skip
|
||||
|
||||
Reference in New Issue
Block a user