Test for unfollowing

master
Bob Mottram 2019-07-03 10:33:28 +01:00
parent 60b59d4f86
commit 983b299792
2 changed files with 13 additions and 14 deletions

View File

@ -93,20 +93,6 @@ session = createSession(domain,port,useTor)
personCache={} personCache={}
cachedWebfingers={} cachedWebfingers={}
clearFollows(baseDir,username,domain)
followPerson(baseDir,username,domain,'badger','wild.com',federationList)
followPerson(baseDir,username,domain,'squirrel','secret.com',federationList)
followPerson(baseDir,username,domain,'rodent','drainpipe.com',federationList)
followPerson(baseDir,username,domain,'batman','mesh.com',federationList)
followPerson(baseDir,username,domain,'giraffe','trees.com',federationList)
clearFollowers(baseDir,username,domain)
followerOfPerson(baseDir,username,domain,'badger','wild.com',federationList)
followerOfPerson(baseDir,username,domain,'squirrel','secret.com',federationList)
followerOfPerson(baseDir,username,domain,'rodent','drainpipe.com',federationList)
followerOfPerson(baseDir,username,domain,'batman','mesh.com',federationList)
followerOfPerson(baseDir,username,domain,'giraffe','trees.com',federationList)
#unfollowPerson(username,domain,'squirrel','secret.com') #unfollowPerson(username,domain,'squirrel','secret.com')
#sys.exit() #sys.exit()

View File

@ -228,12 +228,25 @@ def testFollows():
followPerson(baseDir,username,domain,'giraffe','trees.com',federationList) followPerson(baseDir,username,domain,'giraffe','trees.com',federationList)
f = open(baseDir+'/accounts/'+username+'@'+domain+'/following.txt', "r") f = open(baseDir+'/accounts/'+username+'@'+domain+'/following.txt', "r")
domainFound=False
for followingDomain in f: for followingDomain in f:
testDomain=followingDomain.split('@')[1].replace('\n','') testDomain=followingDomain.split('@')[1].replace('\n','')
if testDomain=='mesh.com':
domainFound=True
if testDomain not in federationList: if testDomain not in federationList:
print(testDomain) print(testDomain)
assert(False) assert(False)
assert(domainFound)
unfollowPerson(baseDir,username,domain,'batman','mesh.com')
domainFound=False
for followingDomain in f:
testDomain=followingDomain.split('@')[1].replace('\n','')
if testDomain=='mesh.com':
domainFound=True
assert(domainFound==False)
clearFollowers(baseDir,username,domain) clearFollowers(baseDir,username,domain)
followerOfPerson(baseDir,username,domain,'badger','wild.com',federationList) followerOfPerson(baseDir,username,domain,'badger','wild.com',federationList)
followerOfPerson(baseDir,username,domain,'squirrel','secret.com',federationList) followerOfPerson(baseDir,username,domain,'squirrel','secret.com',federationList)