More inbox checks

master
Bob Mottram 2019-07-18 10:31:29 +01:00
parent 985e66f0df
commit c70d37cdf2
3 changed files with 5 additions and 3 deletions

View File

@ -232,8 +232,8 @@ if args.tests:
if args.testsnetwork:
print('Network Tests')
#testPostMessageBetweenServers()
#testFollowBetweenServers()
testPostMessageBetweenServers()
testFollowBetweenServers()
testClientToServer()
sys.exit()

View File

@ -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)

View File

@ -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')