Added unittests for markInboxMessageAsRead(msgid) and markInboxMessageAsUnread(msgid)
This commit is contained in:
parent
dd3904059e
commit
a7423a3ad5
|
@ -672,10 +672,11 @@ class TestFeed(unittest.TestCase):
|
||||||
|
|
||||||
assert api.clientStatus > 0, 'Not connected'
|
assert api.clientStatus > 0, 'Not connected'
|
||||||
addr = api.createRandomAddress('senttest')
|
addr = api.createRandomAddress('senttest')
|
||||||
|
counter = 0
|
||||||
while api.getAllInboxMessages() == []:
|
while api.getAllInboxMessages() == []:
|
||||||
ackdata = api.sendMessage(addr,addr,'test','test')
|
if counter > 20:
|
||||||
time.sleep(30)
|
ackdata = api.sendMessage(addr,addr,'test','test')
|
||||||
|
time.sleep(10)
|
||||||
assert api.clientStatus > 0, 'Not connected'
|
assert api.clientStatus > 0, 'Not connected'
|
||||||
|
|
||||||
assert api.getAllInboxMessages() != [],api.getAllInboxMessages()
|
assert api.getAllInboxMessages() != [],api.getAllInboxMessages()
|
||||||
|
@ -686,6 +687,12 @@ class TestFeed(unittest.TestCase):
|
||||||
assert api.getInboxMessageByID(msgid) != []
|
assert api.getInboxMessageByID(msgid) != []
|
||||||
assert api.getInboxMessagesByReceiver(recv) != []
|
assert api.getInboxMessagesByReceiver(recv) != []
|
||||||
|
|
||||||
|
assert api.getInboxMessageByID(msgid)[0]['read'] == 0,api.getInboxMessageByID(msgid)[0]['read']
|
||||||
|
api.markInboxMessageAsRead(msgid)
|
||||||
|
assert api.getInboxMessageByID(msgid)[0]['read'] == 1,api.getInboxMessageByID(msgid)[0]['read']
|
||||||
|
api.markInboxMessageAsUnread(msgid)
|
||||||
|
assert api.getInboxMessageByID(msgid)[0]['read'] == 0,api.getInboxMessageByID(msgid)[0]['read']
|
||||||
|
|
||||||
api.trashInboxMessage(msgid)
|
api.trashInboxMessage(msgid)
|
||||||
messages = api.getAllInboxMessages()
|
messages = api.getAllInboxMessages()
|
||||||
for msg in messages:
|
for msg in messages:
|
||||||
|
|
Reference in New Issue
Block a user