From 5c6a45956c71ef48a679d84a967420daf3aa76fd Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 6 Dec 2020 15:05:22 +0000 Subject: [PATCH] Test for creation of news actor --- tests.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests.py b/tests.py index 4a7fdb1e..7126ea8a 100644 --- a/tests.py +++ b/tests.py @@ -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