tests: Test that we're sending out user updates from the daemon.

This commit is contained in:
Damir Jelić 2019-06-19 15:55:40 +02:00
parent 62d0e5607e
commit 9308dfec3f
2 changed files with 49 additions and 4 deletions

View file

@ -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: