mirror of
https://github.com/chatmail/relay.git
synced 2026-05-19 20:38:05 +00:00
extend imap online test to cover multi-device
This commit is contained in:
@@ -10,6 +10,7 @@ dependencies = [
|
|||||||
"iniconfig",
|
"iniconfig",
|
||||||
"deltachat-rpc-server",
|
"deltachat-rpc-server",
|
||||||
"deltachat-rpc-client",
|
"deltachat-rpc-client",
|
||||||
|
"filelock",
|
||||||
"requests",
|
"requests",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -24,14 +24,27 @@ class TestMetadataTokens:
|
|||||||
def test_set_get_metadata(self, imap_mailbox):
|
def test_set_get_metadata(self, imap_mailbox):
|
||||||
"set and get metadata token for an account"
|
"set and get metadata token for an account"
|
||||||
client = imap_mailbox.client
|
client = imap_mailbox.client
|
||||||
client.send(b'a01 SETMETADATA INBOX (/private/devicetoken "l1kj23lk123" )\n')
|
client.send(b'a01 SETMETADATA INBOX (/private/devicetoken "1111" )\n')
|
||||||
res = client.readline()
|
res = client.readline()
|
||||||
assert b"OK Setmetadata completed" in res
|
assert b"OK Setmetadata completed" in res
|
||||||
|
|
||||||
client.send(b"a02 GETMETADATA INBOX /private/devicetoken\n")
|
client.send(b"a02 GETMETADATA INBOX /private/devicetoken\n")
|
||||||
res = client.readline()
|
res = client.readline()
|
||||||
assert res[:1] == b"*"
|
assert res[:1] == b"*"
|
||||||
res = client.readline().strip()[:-1]
|
res = client.readline().strip().rstrip(b")")
|
||||||
assert res == b"l1kj23lk123"
|
assert res == b"1111"
|
||||||
|
assert b"Getmetadata completed" in client.readline()
|
||||||
|
|
||||||
|
client.send(b'a01 SETMETADATA INBOX (/private/devicetoken "2222" )\n')
|
||||||
|
res = client.readline()
|
||||||
|
assert b"OK Setmetadata completed" in res
|
||||||
|
|
||||||
|
client.send(b"a02 GETMETADATA INBOX /private/devicetoken\n")
|
||||||
|
res = client.readline()
|
||||||
|
assert res[:1] == b"*"
|
||||||
|
res = client.readline().strip().rstrip(b")")
|
||||||
|
assert res == b"1111 2222"
|
||||||
|
assert b"Getmetadata completed" in client.readline()
|
||||||
|
|
||||||
|
|
||||||
class TestEndToEndDeltaChat:
|
class TestEndToEndDeltaChat:
|
||||||
|
|||||||
Reference in New Issue
Block a user