mirror of https://gitlab.com/bashrc2/epicyon
Receiving likes
parent
c301f45b33
commit
f301139626
|
@ -388,7 +388,6 @@ if args.changepassword:
|
||||||
if not args.domain and not domain:
|
if not args.domain and not domain:
|
||||||
print('Specify a domain with --domain [name]')
|
print('Specify a domain with --domain [name]')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
|
||||||
if federationList:
|
if federationList:
|
||||||
print('Federating with: '+str(federationList))
|
print('Federating with: '+str(federationList))
|
||||||
|
@ -400,10 +399,6 @@ if not os.path.isdir(baseDir+'/accounts/'+nickname+'@'+domain):
|
||||||
setConfigParam(baseDir,'adminPassword',adminPassword)
|
setConfigParam(baseDir,'adminPassword',adminPassword)
|
||||||
createPerson(baseDir,nickname,domain,port,httpPrefix,True,adminPassword)
|
createPerson(baseDir,nickname,domain,port,httpPrefix,True,adminPassword)
|
||||||
|
|
||||||
#if not os.path.isdir(baseDir+'/accounts/capabilities@'+domain):
|
|
||||||
# print('Creating capabilities account which can sign requests')
|
|
||||||
# createCapabilitiesInbox(baseDir,'capabilities',domain,port,httpPrefix)
|
|
||||||
|
|
||||||
if args.testdata:
|
if args.testdata:
|
||||||
nickname='testuser567'
|
nickname='testuser567'
|
||||||
print('Generating some test data for user: '+nickname)
|
print('Generating some test data for user: '+nickname)
|
||||||
|
|
4
inbox.py
4
inbox.py
|
@ -432,8 +432,8 @@ def receiveLike(session,handle: str,baseDir: str, \
|
||||||
print(messageJson['object'])
|
print(messageJson['object'])
|
||||||
return True
|
return True
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: liked post found in '+boxName)
|
print('DEBUG: liked post found in inbox')
|
||||||
updateLikesCollection(postFilename,messageJson['object'],messageJson['actor'])
|
updateLikesCollection(postFilename,messageJson['object'],messageJson['actor'],debug)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def inboxAfterCapabilities(session,keyId: str,handle: str,messageJson: {}, \
|
def inboxAfterCapabilities(session,keyId: str,handle: str,messageJson: {}, \
|
||||||
|
|
64
tests.py
64
tests.py
|
@ -278,43 +278,41 @@ def testPostMessageBetweenServers():
|
||||||
# queue item removed
|
# queue item removed
|
||||||
assert len([name for name in os.listdir(queuePath) if os.path.isfile(os.path.join(queuePath, name))])==0
|
assert len([name for name in os.listdir(queuePath) if os.path.isfile(os.path.join(queuePath, name))])==0
|
||||||
|
|
||||||
#print('\n\n*******************************************************')
|
print('\n\n*******************************************************')
|
||||||
#print("Bob likes Alice's post")
|
print("Bob likes Alice's post")
|
||||||
|
|
||||||
#followerOfPerson(bobDir,'bob',bobDomain,'alice',aliceDomain+':'+str(alicePort),federationList,True)
|
followerOfPerson(bobDir,'bob',bobDomain,'alice',aliceDomain+':'+str(alicePort),federationList,True)
|
||||||
#followPerson(aliceDir,'alice',aliceDomain,'bob',bobDomain+':'+str(bobPort),federationList,True)
|
followPerson(aliceDir,'alice',aliceDomain,'bob',bobDomain+':'+str(bobPort),federationList,True)
|
||||||
#followList=getFollowersOfPerson(bobDir,'bob',bobDomain,'followers.txt')
|
|
||||||
#assert len(followList)==1
|
|
||||||
|
|
||||||
#sessionBob = createSession(bobDomain,bobPort,useTor)
|
sessionBob = createSession(bobDomain,bobPort,useTor)
|
||||||
#bobSendThreads = []
|
bobSendThreads = []
|
||||||
#bobPostLog = []
|
bobPostLog = []
|
||||||
#bobPersonCache={}
|
bobPersonCache={}
|
||||||
#bobCachedWebfingers={}
|
bobCachedWebfingers={}
|
||||||
#statusNumber=None
|
statusNumber=None
|
||||||
#outboxPostFilename=None
|
outboxPostFilename=None
|
||||||
#outboxPath=aliceDir+'/accounts/alice@'+aliceDomain+'/outbox'
|
outboxPath=aliceDir+'/accounts/alice@'+aliceDomain+'/outbox'
|
||||||
#for name in os.listdir(outboxPath):
|
for name in os.listdir(outboxPath):
|
||||||
# if '#statuses#' in name:
|
if '#statuses#' in name:
|
||||||
# statusNumber=int(name.split('#statuses#')[1].replace('.json',''))
|
statusNumber=int(name.split('#statuses#')[1].replace('.json',''))
|
||||||
# outboxPostFilename=outboxPath+'/'+name
|
outboxPostFilename=outboxPath+'/'+name
|
||||||
#assert statusNumber
|
assert statusNumber
|
||||||
#assert outboxPostFilename
|
assert outboxPostFilename
|
||||||
#assert likePost(sessionBob,bobDir,federationList, \
|
assert likePost(sessionBob,bobDir,federationList, \
|
||||||
# 'bob',bobDomain,bobPort,httpPrefix, \
|
'bob',bobDomain,bobPort,httpPrefix, \
|
||||||
# 'alice',aliceDomain,alicePort,[], \
|
'alice',aliceDomain,alicePort,[], \
|
||||||
# statusNumber,False,bobSendThreads,bobPostLog, \
|
statusNumber,False,bobSendThreads,bobPostLog, \
|
||||||
# bobPersonCache,bobCachedWebfingers,True)
|
bobPersonCache,bobCachedWebfingers,True)
|
||||||
|
|
||||||
#for i in range(20):
|
for i in range(20):
|
||||||
# if 'likes' in open(outboxPostFilename).read():
|
if 'likes' in open(outboxPostFilename).read():
|
||||||
# break
|
break
|
||||||
# time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
#with open(outboxPostFilename, 'r') as fp:
|
with open(outboxPostFilename, 'r') as fp:
|
||||||
# alicePostJson=commentjson.load(fp)
|
alicePostJson=commentjson.load(fp)
|
||||||
# pprint(alicePostJson)
|
pprint(alicePostJson)
|
||||||
#assert 'likes' in open(outboxPostFilename).read()
|
assert 'likes' in open(outboxPostFilename).read()
|
||||||
|
|
||||||
# stop the servers
|
# stop the servers
|
||||||
thrAlice.kill()
|
thrAlice.kill()
|
||||||
|
|
Loading…
Reference in New Issue