Check that inbox is updated

master
Bob Mottram 2019-07-04 21:36:12 +01:00
parent 8d02e8fdc2
commit 502668fb34
1 changed files with 12 additions and 2 deletions

View File

@ -8,7 +8,7 @@ __status__ = "Production"
import base64 import base64
import time import time
import os import os, os.path
import shutil import shutil
from person import createPerson from person import createPerson
from Crypto.Hash import SHA256 from Crypto.Hash import SHA256
@ -208,7 +208,12 @@ def testPostMessageBetweenServers():
sendResult = sendPost(sessionAlice,aliceDir,'alice', aliceDomain, alicePort, 'bob', bobDomain, bobPort, ccUrl, httpPrefix, 'Why is a mouse when it spins?', followersOnly, saveToFile, clientToServer, federationList, aliceSendThreads, alicePostLog, aliceCachedWebfingers,alicePersonCache,inReplyTo, inReplyToAtomUri, subject) sendResult = sendPost(sessionAlice,aliceDir,'alice', aliceDomain, alicePort, 'bob', bobDomain, bobPort, ccUrl, httpPrefix, 'Why is a mouse when it spins?', followersOnly, saveToFile, clientToServer, federationList, aliceSendThreads, alicePostLog, aliceCachedWebfingers,alicePersonCache,inReplyTo, inReplyToAtomUri, subject)
print('sendResult: '+str(sendResult)) print('sendResult: '+str(sendResult))
for i in range(5): queuePath=bobDir+'/accounts/bob@'+bobDomain+'/queue'
inboxPath=bobDir+'/accounts/bob@'+bobDomain+'/inbox'
for i in range(10):
if os.path.isdir(inboxPath):
if len([name for name in os.listdir(inboxPath) if os.path.isfile(os.path.join(inboxPath, name))])>0:
break
time.sleep(1) time.sleep(1)
# stop the servers # stop the servers
@ -220,6 +225,11 @@ def testPostMessageBetweenServers():
thrBob.join() thrBob.join()
assert thrBob.isAlive()==False assert thrBob.isAlive()==False
# inbox item created
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
def testFollows(): def testFollows():
print('testFollows') print('testFollows')
currDir=os.getcwd() currDir=os.getcwd()