From c70d37cdf2e1b0660997959b93083a1a26212253 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 18 Jul 2019 10:31:29 +0100 Subject: [PATCH] More inbox checks --- epicyon.py | 4 ++-- inbox.py | 2 +- tests.py | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/epicyon.py b/epicyon.py index ce2580cf..9c6f41c9 100644 --- a/epicyon.py +++ b/epicyon.py @@ -232,8 +232,8 @@ if args.tests: if args.testsnetwork: print('Network Tests') - #testPostMessageBetweenServers() - #testFollowBetweenServers() + testPostMessageBetweenServers() + testFollowBetweenServers() testClientToServer() sys.exit() diff --git a/inbox.py b/inbox.py index dc9d116d..8e30c8b3 100644 --- a/inbox.py +++ b/inbox.py @@ -1177,7 +1177,7 @@ def runInboxQueue(baseDir: str,httpPrefix: str,sendThreads: [],postLog: [], \ # any checking will needs to be handled at the time when inbox # GET happens on individual accounts. # See posts.py/createBoxBase - if len(recipientsDictFollowers)>0: + if len(recipientsDictFollowers)>0: with open(queueJson['destination'].replace(inboxHandle,inboxHandle), 'w') as fp: commentjson.dump(queueJson['post'], fp, indent=4, sort_keys=False) diff --git a/tests.py b/tests.py index c408e768..232bd212 100644 --- a/tests.py +++ b/tests.py @@ -365,6 +365,7 @@ def testPostMessageBetweenServers(): assert len([name for name in os.listdir(inboxPath) if os.path.isfile(os.path.join(inboxPath, name))])==1 # queue item removed assert len([name for name in os.listdir(queuePath) if os.path.isfile(os.path.join(queuePath, name))])==0 + assert validInbox(bobDir,'bob',bobDomain) print('\n\n*******************************************************') print("Bob likes Alice's post") @@ -560,6 +561,7 @@ def testFollowBetweenServers(): print("Unexpected format for Bob's capabilities") pprint(bobCapsJson) assert False + assert validInbox(bobDir,'bob',bobDomain) print('\n\n*********************************************************') print('Eve tries to send to Bob')