forked from indymedia/epicyon
Add checks for followers and following
parent
3a6fe719a9
commit
755d28f3e1
|
@ -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 '+ \
|
||||
|
|
13
tests.py
13
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')
|
||||
|
|
Loading…
Reference in New Issue