| 47 | calls = [] |
| 48 | |
| 49 | class FakeSession: |
| 50 | def post(self, url, **kwargs): |
| 51 | calls.append({"url": url, "kwargs": kwargs}) |
| 52 | if url.endswith("/api/user/login"): |
| 53 | response = FakeResponse(status_code=200, payload={"success": True}) |
| 54 | response.cookies = {"session": "cookie"} |
| 55 | return response |
| 56 | if url.endswith("/api/channel/"): |
| 57 | return FakeResponse(status_code=200, payload={"success": True}) |
| 58 | raise AssertionError(url) |
| 59 | |
| 60 | def fake_create_session(api_url, username, password): |
| 61 | session = FakeSession() |
no outgoing calls