Added anouncement addr comment, replaces assertTrue with assertEqual & added print for getAllInboxMessages to check build failure

This commit is contained in:
kuldeep.k@cisinlabs.com 2021-11-26 20:08:51 +05:30
parent 56ec5b8a03
commit 62ffe96bc8
No known key found for this signature in database
GPG Key ID: AF4FB299BF7C7C2A
2 changed files with 15 additions and 8 deletions

View File

@ -39,5 +39,6 @@ sample_daddr4_512 = 25152821841976547050350277460563089811513157529113201589004
sample_statusbar_msg = "new status bar message"
sample_inbox_msg_ids = ['27e644765a3e4b2e973ee7ccf958ea20', '51fc5531-3989-4d69-bbb5-68d64b756f5b',
'2c975c515f8b414db5eea60ba57ba455', 'bc1f2d8a-681c-4cc0-9a12-6067c7e1ac24']
# second address in sample_test_subscription_address is for the announcement broadcast
sample_test_subscription_address = ['BM-2cWQLCBGorT9pUGkYSuGGVr9LzE4mRnQaq', 'BM-GtovgYdgs7qXPkoYaRgrLFuFKz1SFpsw']
sample_subscription_name = 'test sub'

View File

@ -99,21 +99,27 @@ class TestAPI(TestAPIProto):
def test_message_inbox(self):
"""Test message inbox methods"""
self.assertTrue(
print("getAllInboxMessages: ", json.loads(
self.api.getAllInboxMessages())["inboxMessages"])
self.assertEqual(
len(json.loads(
self.api.getAllInboxMessages())["inboxMessages"]) == 2
self.api.getAllInboxMessages())["inboxMessages"]),
2
)
self.assertTrue(
self.assertEqual(
len(json.loads(
self.api.getAllInboxMessageIds())["inboxMessageIds"]) == 2
self.api.getAllInboxMessageIds())["inboxMessageIds"]),
2
)
self.assertTrue(
self.assertEqual(
len(json.loads(
self.api.getInboxMessageById(hexlify(sample_inbox_msg_ids[2])))["inboxMessage"]) == 1
self.api.getInboxMessageById(hexlify(sample_inbox_msg_ids[2])))["inboxMessage"]),
1
)
self.assertTrue(
self.assertEqual(
len(json.loads(
self.api.getInboxMessagesByReceiver(sample_deterministic_addr4))["inboxMessages"]) == 2
self.api.getInboxMessagesByReceiver(sample_deterministic_addr4))["inboxMessages"]),
2
)
def test_delete_message(self):