Fix unit tests

merge-requests/30/head
Bob Mottram 2021-05-13 21:16:43 +01:00
parent e58e7ce059
commit 0b19087c88
3 changed files with 6 additions and 9 deletions

View File

@ -128,7 +128,7 @@ def _getCityPulse(currTimeOfDay, decoySeed: int) -> (float, float):
def spoofGeolocation(baseDir: str, def spoofGeolocation(baseDir: str,
city: str, currTime, decoySeed: int, city: str, currTime, decoySeed: int,
citiesList: []) -> (float, float, str, str, \ citiesList: []) -> (float, float, str, str,
str, str, int): str, str, int):
"""Given a city and the current time spoofs the location """Given a city and the current time spoofs the location
for an image for an image

View File

@ -593,10 +593,14 @@ def personUpgradeActor(baseDir: str, personJson: {},
updateActor = True updateActor = True
if not personJson.get('affiliation'): if not personJson.get('affiliation'):
rolesStr = ''
adminName = getConfigParam(baseDir, 'admin')
if personJson['id'].endswith('/users/' + adminName):
rolesStr = 'admin'
statusNumber, published = getStatusNumber() statusNumber, published = getStatusNumber()
personJson['affiliation'] = { personJson['affiliation'] = {
"@type": "OrganizationRole", "@type": "OrganizationRole",
"roleName": "", "roleName": rolesStr,
"affiliation": { "affiliation": {
"@type": "WebSite", "@type": "WebSite",
"url": personJson['id'].split('/users/')[0] "url": personJson['id'].split('/users/')[0]

View File

@ -7,13 +7,6 @@ __email__ = "bob@freedombone.net"
__status__ = "Production" __status__ = "Production"
import os import os
from webfinger import webfingerHandle
from auth import createBasicAuthHeader
from posts import getPersonBox
from session import postJson
from utils import getFullDomain
from utils import getNicknameFromActor
from utils import getDomainFromActor
from utils import loadJson from utils import loadJson
from utils import saveJson from utils import saveJson