make unit tests run without manual opt outs file

for aaf115347e
pull/741/head
Ryan Barrett 2023-11-29 10:39:13 -08:00
rodzic aaf115347e
commit 8dab5a8a13
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
1 zmienionych plików z 7 dodań i 3 usunięć

Wyświetl plik

@ -2,7 +2,7 @@
import base64
from datetime import timedelta
import logging
import os
from pathlib import Path
import re
import threading
import urllib.parse
@ -65,8 +65,12 @@ DOMAIN_BLOCKLIST = (
'twitter.com',
)
with open(os.path.join(os.path.dirname(__file__), 'opt_outs.txt')) as f:
OPT_OUT_IDS = util.load_file_lines(f)
opt_outs = Path(__file__).parent / 'opt_outs.txt'
if opt_outs.exists():
with opt_outs.open() as f:
OPT_OUT_IDS = util.load_file_lines(f)
else:
OPT_OUT_IDS = {'fake:bridgy-fed:test-opt-out'}
# populated in models.reset_protocol_properties
SUBDOMAIN_BASE_URL_RE = None