move test_atproto.KEY to testutil.ATPROTO_KEY

pull/729/head
Ryan Barrett 2023-11-13 13:30:15 -08:00
rodzic 12158eba64
commit 00fb4dd14d
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
3 zmienionych plików z 7 dodań i 6 usunięć

Wyświetl plik

@ -420,6 +420,7 @@ def poll_notifications():
repos = {r.key.id(): r for r in AtpRepo.query()}
logger.info(f'Got {len(repos)} repos')
# TODO: switch from atproto_did to copies
users = itertools.chain(*(cls.query(cls.atproto_did.IN(list(repos)))
for cls in set(PROTOCOLS.values())
if cls and cls != ATProto))

Wyświetl plik

@ -30,7 +30,7 @@ import common
import hub
from models import Object, Target
import protocol
from .testutil import Fake, TestCase
from .testutil import ATPROTO_KEY, Fake, TestCase
from . import test_activitypub
DID_DOC = {
@ -50,8 +50,6 @@ DID_DOC = {
}
BLOB_CID = CID.decode('bafkreicqpqncshdd27sgztqgzocd3zhhqnnsv6slvzhs5uz6f57cq6lmtq')
KEY = arroba.util.new_key(2349823483510) # deterministic seed
class ATProtoTest(TestCase):
@ -66,7 +64,7 @@ class ATProtoTest(TestCase):
did_doc = copy.deepcopy(DID_DOC)
did_doc['service'][0]['serviceEndpoint'] = 'https://atproto.brid.gy/'
self.store_object(id='did:plc:user', raw=did_doc)
Repo.create(self.storage, 'did:plc:user', signing_key=KEY)
Repo.create(self.storage, 'did:plc:user', signing_key=ATPROTO_KEY)
return user
@ -619,8 +617,8 @@ class ATProtoTest(TestCase):
user_b = self.make_user(id='fake:user-c', cls=Fake, atproto_did=f'did:plc:b')
user_c = self.make_user(id='fake:user-b', cls=Fake, atproto_did=f'did:plc:c')
Repo.create(self.storage, 'did:plc:a', signing_key=KEY)
Repo.create(self.storage, 'did:plc:c', signing_key=KEY)
Repo.create(self.storage, 'did:plc:a', signing_key=ATPROTO_KEY)
Repo.create(self.storage, 'did:plc:c', signing_key=ATPROTO_KEY)
like = {
'$type': 'app.bsky.feed.like',

Wyświetl plik

@ -40,6 +40,8 @@ import protocol
logger = logging.getLogger(__name__)
ATPROTO_KEY = arroba.util.new_key(2349823483510) # deterministic seed
NOTE = {
**NOTE,
# bare string author id