kopia lustrzana https://github.com/snarfed/bridgy-fed
move test_atproto.KEY to testutil.ATPROTO_KEY
rodzic
12158eba64
commit
00fb4dd14d
|
@ -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))
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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
|
||||
|
|
Ładowanie…
Reference in New Issue