diff --git a/follow.py b/follow.py index 4ec27282e..5ef879189 100644 --- a/follow.py +++ b/follow.py @@ -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 '+ \ diff --git a/tests.py b/tests.py index e63a5c402..de9e34507 100644 --- a/tests.py +++ b/tests.py @@ -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')