mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 12:56:30 +03:00
test: add test for get_http_response JSON-RPC call
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import base64
|
||||||
import concurrent.futures
|
import concurrent.futures
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
@@ -613,3 +614,10 @@ def test_markseen_contact_request(acfactory, tmp_path):
|
|||||||
if event.kind == EventType.MSGS_NOTICED:
|
if event.kind == EventType.MSGS_NOTICED:
|
||||||
break
|
break
|
||||||
assert message2.get_snapshot().state == MessageState.IN_SEEN
|
assert message2.get_snapshot().state == MessageState.IN_SEEN
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_http_response(acfactory):
|
||||||
|
alice = acfactory.new_configured_account()
|
||||||
|
http_response = alice._rpc.get_http_response(alice.id, "https://example.org")
|
||||||
|
assert http_response["mimetype"] == "text/html"
|
||||||
|
assert b"<title>Example Domain</title>" in base64.b64decode((http_response["blob"] + "==").encode())
|
||||||
|
|||||||
Reference in New Issue
Block a user