Test for creation of news actor

main
Bob Mottram 2020-12-06 15:05:22 +00:00
parent ad71c09aee
commit 5c6a45956c
1 changed files with 14 additions and 0 deletions

View File

@ -547,6 +547,20 @@ def testPostMessageBetweenServers():
break
time.sleep(1)
# check that a news account exists
newsActorDir = aliceDir + '/accounts/news@' + aliceDomain
print("newsActorDir: " + newsActorDir)
assert os.path.isdir(newsActorDir)
newsActorFile = newsActorDir + '.json'
assert os.path.isfile(newsActorFile)
newsActorJson = loadJson(newsActorFile)
assert newsActorJson
assert newsActorJson.get("id")
# check the id of the news actor
print('News actor Id: ' + newsActorJson["id"])
assert (newsActorJson["id"] ==
httpPrefix + '://' + aliceAddress + '/users/news')
# Image attachment created
assert len([name for name in os.listdir(mediaPath)
if os.path.isfile(os.path.join(mediaPath, name))]) > 0