mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
6863d3bf62
commit
9ad912aec5
13
posts.py
13
posts.py
|
@ -205,8 +205,6 @@ def parseUserFeed(session, feedUrl: str, asHeader: {},
|
|||
pprint(feedJson)
|
||||
|
||||
if 'orderedItems' in feedJson:
|
||||
#for item in feedJson['orderedItems']:
|
||||
# yield item
|
||||
return feedJson['orderedItems']
|
||||
|
||||
nextUrl = None
|
||||
|
@ -217,7 +215,7 @@ def parseUserFeed(session, feedUrl: str, asHeader: {},
|
|||
|
||||
if debug:
|
||||
print('User feed next url: ' + str(nextUrl))
|
||||
|
||||
|
||||
if nextUrl:
|
||||
if isinstance(nextUrl, str):
|
||||
if '?max_id=0' not in nextUrl:
|
||||
|
@ -225,15 +223,11 @@ def parseUserFeed(session, feedUrl: str, asHeader: {},
|
|||
parseUserFeed(session, nextUrl, asHeader,
|
||||
projectVersion, httpPrefix,
|
||||
domain, debug, depth + 1)
|
||||
if userFeed:
|
||||
#for item in userFeed:
|
||||
# yield item
|
||||
if userFeed:
|
||||
return userFeed
|
||||
elif isinstance(nextUrl, dict):
|
||||
userFeed = nextUrl
|
||||
if userFeed.get('orderedItems'):
|
||||
#for item in userFeed['orderedItems']:
|
||||
# yield item
|
||||
return userFeed['orderedItems']
|
||||
return None
|
||||
|
||||
|
@ -546,8 +540,7 @@ def _getPosts(session, outboxUrl: str, maxPosts: int,
|
|||
"plaintext": _cleanHtml(content),
|
||||
"attachment": attachment,
|
||||
"mentions": mentions,
|
||||
"emoji": emoji,
|
||||
"conversation": conversation
|
||||
"emoji": emoji
|
||||
}
|
||||
i += 1
|
||||
|
||||
|
|
9
tests.py
9
tests.py
|
@ -1475,7 +1475,8 @@ def testGroupFollow():
|
|||
assert validInboxFilenames(testgroupDir, 'testgroup', testgroupDomain,
|
||||
aliceDomain, alicePort)
|
||||
assert 'alice@' + aliceDomain in open(testgroupFollowersFilename).read()
|
||||
assert '!alice@' + aliceDomain not in open(testgroupFollowersFilename).read()
|
||||
assert '!alice@' + aliceDomain not in \
|
||||
open(testgroupFollowersFilename).read()
|
||||
|
||||
testgroupWebfingerFilename = \
|
||||
testgroupDir + '/wfendpoints/testgroup@' + \
|
||||
|
@ -1573,7 +1574,7 @@ def testGroupFollow():
|
|||
print('\n\n*********************************************************')
|
||||
print('Alice posts to the test group')
|
||||
inboxPathBob = \
|
||||
bobDir + '/accounts/bob@' + bobDomain + '/inbox'
|
||||
bobDir + '/accounts/bob@' + bobDomain + '/inbox'
|
||||
startPostsBob = \
|
||||
len([name for name in os.listdir(inboxPathBob)
|
||||
if os.path.isfile(os.path.join(inboxPathBob, name))])
|
||||
|
@ -1620,7 +1621,7 @@ def testGroupFollow():
|
|||
print('\n\n*********************************************************')
|
||||
print('Check that post was relayed from test group to bob')
|
||||
|
||||
# bobMessageArrived = False
|
||||
# bobMessageArrived = False
|
||||
for i in range(20):
|
||||
time.sleep(1)
|
||||
if os.path.isdir(inboxPathBob):
|
||||
|
@ -1628,7 +1629,7 @@ def testGroupFollow():
|
|||
len([name for name in os.listdir(inboxPathBob)
|
||||
if os.path.isfile(os.path.join(inboxPathBob, name))])
|
||||
if currPostsBob > startPostsBob:
|
||||
# bobMessageArrived = True
|
||||
# bobMessageArrived = True
|
||||
print('Bob received relayed group post!')
|
||||
break
|
||||
|
||||
|
|
Loading…
Reference in New Issue