Add checks for followers and following

master
Bob Mottram 2019-07-06 18:15:03 +01:00
parent 3a6fe719a9
commit 755d28f3e1
2 changed files with 11 additions and 6 deletions

View File

@ -292,8 +292,8 @@ def receiveFollowRequest(session,baseDir: str,httpPrefix: str, \
print('DEBUG: followed account not found - '+ \
baseDir+'/accounts/'+handleToFollow)
return False
if not followerOfPerson(baseDir,nickname,domain, \
nicknameToFollow,domainToFollow,federationList):
if not followerOfPerson(baseDir,nicknameToFollow,domainToFollow, \
nickname,domain,federationList):
if debug:
print('DEBUG: '+nickname+'@'+domain+ \
' is already a follower of '+ \

View File

@ -310,9 +310,11 @@ def testFollowBetweenServers():
aliceCachedWebfingers,alicePersonCache,True)
print('sendResult: '+str(sendResult))
time.sleep(10)
for t in range(10):
if os.path.isfile(bobDir+'/accounts/bob@'+bobDomain+'/followers.txt'):
break
time.sleep(1)
# stop the servers
thrAlice.kill()
thrAlice.join()
@ -322,8 +324,11 @@ def testFollowBetweenServers():
thrBob.join()
assert thrBob.isAlive()==False
assert 'alice@'+aliceDomain in open(bobDir+'/accounts/bob@'+bobDomain+'/followers.txt').read()
assert 'bob@'+bobDomain in open(aliceDir+'/accounts/alice@'+aliceDomain+'/following.txt').read()
os.chdir(baseDir)
#shutil.rmtree(baseDir+'/.tests')
shutil.rmtree(baseDir+'/.tests')
def testFollowersOfPerson():
print('testFollowersOfPerson')