mirror of
https://github.com/matrix-org/pantalaimon.git
synced 2025-12-09 21:45:50 -05:00
tests: Test that we're sending out user updates from the daemon.
This commit is contained in:
parent
62d0e5607e
commit
9308dfec3f
2 changed files with 49 additions and 4 deletions
|
|
@ -125,11 +125,43 @@ async def pan_proxy_server(tempdir, aiohttp_server):
|
|||
|
||||
server = await aiohttp_server(app)
|
||||
|
||||
yield server, proxy
|
||||
yield server, proxy, (pan_queue, ui_queue)
|
||||
|
||||
await proxy.shutdown(app)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def running_proxy(pan_proxy_server, aioresponse, aiohttp_client):
|
||||
server, proxy, queues = pan_proxy_server
|
||||
|
||||
login_response = {
|
||||
"access_token": "abc123",
|
||||
"device_id": "GHTYAJCE",
|
||||
"home_server": "example.org",
|
||||
"user_id": "@example:example.org"
|
||||
}
|
||||
|
||||
aioclient = await aiohttp_client(server)
|
||||
|
||||
aioresponse.post(
|
||||
"https://example.org/_matrix/client/r0/login",
|
||||
status=200,
|
||||
payload=login_response,
|
||||
repeat=True
|
||||
)
|
||||
|
||||
await aioclient.post(
|
||||
"/_matrix/client/r0/login",
|
||||
json={
|
||||
"type": "m.login.password",
|
||||
"user": "example",
|
||||
"password": "wordpass",
|
||||
}
|
||||
)
|
||||
|
||||
yield server, aioclient, proxy, queues
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def aioresponse():
|
||||
with aioresponses(passthrough=["http://127.0.0.1"]) as m:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue