diff --git a/tests.py b/tests.py index 23eb4b23..d526b225 100644 --- a/tests.py +++ b/tests.py @@ -40,6 +40,7 @@ from follow import sendUnfollowRequestViaServer from utils import followPerson from utils import getNicknameFromActor from utils import getDomainFromActor +from utils import copytree from follow import followerOfPerson from follow import unfollowPerson from follow import unfollowerOfPerson @@ -65,6 +66,8 @@ from delete import sendDeleteViaServer from inbox import validInbox from inbox import validInboxFilenames from content import addWebLinks +from content import replaceEmojiFromTags +from content import addHtmlTags testServerAliceRunning = False testServerBobRunning = False @@ -1374,9 +1377,51 @@ def testWebLinks(): exampleText='This post has a web links https://somesite.net\n\nAnd some other text' linkedText=addWebLinks(exampleText) assert 'somesite.net bool: if recipient.endswith('#Public'): return True return False + +def copytree(src: str, dst: str, symlinks=False, ignore=None): + """Copy a directory + """ + for item in os.listdir(src): + s = os.path.join(src, item) + d = os.path.join(dst, item) + if os.path.isdir(s): + shutil.copytree(s, d, symlinks, ignore) + else: + shutil.copy2(s, d)