atproto_firehose: add missing import

pull/1319/head
Ryan Barrett 2024-09-10 12:42:49 -07:00
rodzic 72877b7f11
commit a8b4333759
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
2 zmienionych plików z 10 dodań i 0 usunięć

Wyświetl plik

@ -31,6 +31,7 @@ from common import (
global_cache,
global_cache_policy,
global_cache_timeout_policy,
report_error,
report_exception,
USER_AGENT,
)

Wyświetl plik

@ -574,3 +574,12 @@ class ATProtoFirehoseHandleTest(TestCase):
self.assertEqual(orig_objs, Object.query().count())
mock_create_task.assert_not_called()
@patch.object(common.error_reporting_client, 'report_exception')
@patch.object(Object, 'get_or_create', side_effect=RuntimeError('oops'))
@patch('common.DEBUG', new=False) # with DEBUG True, report_error just raises
def test_exception_continues(self, mock_create_task, _, __):
commits.put(Op(repo='did:plc:user', action='create', seq=789,
path='app.bsky.feed.post/123', record=REPLY_BSKY))
handle(limit=1)
# just check that we return instead of raising