kopia lustrzana https://github.com/snarfed/bridgy-fed
bluesky: app.bsky.graph.getFollowers, handle no user
rodzic
c1148ee3de
commit
2b2dfafc18
|
@ -45,6 +45,10 @@ OTHER_FOLLOW_AS2['actor'].update({
|
|||
@patch('requests.get')
|
||||
class XrpcGraphTest(testutil.TestCase):
|
||||
|
||||
def test_getProfile_no_user(self, _):
|
||||
resp = self.client.get('/xrpc/app.bsky.graph.getFollowers')
|
||||
self.assertEqual(400, resp.status_code)
|
||||
|
||||
def test_getFollowers_not_domain(self, mock_get):
|
||||
resp = self.client.get('/xrpc/app.bsky.graph.getFollowers',
|
||||
query_string={'user': 'not a domain'})
|
||||
|
|
|
@ -22,7 +22,7 @@ def get_followers(query_prop, output_field, user=None, limit=50, before=None):
|
|||
dict, XRPC method output
|
||||
"""
|
||||
# TODO: what is user?
|
||||
if not re.match(util.DOMAIN_RE, user):
|
||||
if not user or not re.match(util.DOMAIN_RE, user):
|
||||
raise ValueError(f'{user} is not a domain')
|
||||
|
||||
followers = []
|
||||
|
|
Ładowanie…
Reference in New Issue