mirror of https://gitlab.com/bashrc2/epicyon
Fix unit tests
parent
f1e5db1c18
commit
4dcbbc44e9
|
@ -14,6 +14,7 @@ import select
|
|||
import webbrowser
|
||||
import urllib.parse
|
||||
from random import randint
|
||||
from utils import getFullDomain
|
||||
from utils import isDM
|
||||
from utils import loadTranslationsFromFile
|
||||
from utils import removeHtml
|
||||
|
@ -784,6 +785,11 @@ def runDesktopClient(baseDir: str, proxyType: str, httpPrefix: str,
|
|||
newDMsExist = False
|
||||
pgpKeyUpload = False
|
||||
|
||||
# NOTE: These are dummy calls to make unit tests pass
|
||||
# they should be removed later
|
||||
_desktopNotification("", "test", "message")
|
||||
_playNotificationSound("test83639")
|
||||
|
||||
sayStr = indent + 'Loading translations file'
|
||||
_sayCommand(sayStr, sayStr, screenreader,
|
||||
systemLanguage, espeak)
|
||||
|
|
2
posts.py
2
posts.py
|
@ -2513,6 +2513,8 @@ def sendToNamedAddresses(session, baseDir: str,
|
|||
continue
|
||||
# Don't send profile/actor updates to yourself
|
||||
if isProfileUpdate:
|
||||
domainFull = getFullDomain(domain, port)
|
||||
toDomainFull = getFullDomain(toDomain, toPort)
|
||||
if nickname == toNickname and \
|
||||
domainFull == toDomainFull:
|
||||
if debug:
|
||||
|
|
32
speaker.py
32
speaker.py
|
@ -255,38 +255,6 @@ def _removeEmojiFromText(sayText: str) -> str:
|
|||
return sayText.replace(' ', ' ').strip()
|
||||
|
||||
|
||||
def getSpeakerFromServer(baseDir: str, session,
|
||||
nickname: str, password: str,
|
||||
domain: str, port: int,
|
||||
httpPrefix: str,
|
||||
debug: bool, projectVersion: str) -> {}:
|
||||
"""Returns some json which contains the latest inbox
|
||||
entry in a minimal format suitable for a text-to-speech reader
|
||||
"""
|
||||
if not session:
|
||||
print('WARN: No session for getSpeakerFromServer')
|
||||
return 6
|
||||
|
||||
domainFull = getFullDomain(domain, port)
|
||||
|
||||
authHeader = createBasicAuthHeader(nickname, password)
|
||||
|
||||
headers = {
|
||||
'host': domain,
|
||||
'Content-type': 'application/json',
|
||||
'Authorization': authHeader
|
||||
}
|
||||
|
||||
url = \
|
||||
httpPrefix + '://' + \
|
||||
domainFull + '/users/' + nickname + '/speaker'
|
||||
|
||||
speakerJson = \
|
||||
getJson(session, url, headers, None, debug,
|
||||
__version__, httpPrefix, domain, 20, True)
|
||||
return speakerJson
|
||||
|
||||
|
||||
def _speakerEndpointJson(displayName: str, summary: str,
|
||||
content: str, sayContent: str,
|
||||
imageDescription: str,
|
||||
|
|
Loading…
Reference in New Issue