webfinger: misc noop comment and test tweaks

flask
Ryan Barrett 2021-03-12 14:30:24 -08:00
rodzic a4fede524f
commit 17fa355226
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
2 zmienionych plików z 11 dodań i 12 usunięć

Wyświetl plik

@ -1,7 +1,9 @@
# coding=utf-8
"""Unit tests for webfinger.py.
TODO: test error handling
to test:
* user URL that redirects
* error handling
"""
from unittest import mock
import urllib.parse
@ -17,8 +19,6 @@ import models
from webfinger import UserHandler, WebfingerHandler
from . import testutil
USER = 'foo.com@foo.com'
class WebfingerTest(testutil.TestCase):
@ -36,7 +36,7 @@ class WebfingerTest(testutil.TestCase):
"""
self.key = models.MagicKey.get_or_create('foo.com')
self.expected_webfinger = {
'subject': 'acct:' + USER,
'subject': 'acct:foo.com@foo.com',
'aliases': [
'https://foo.com/about-me',
'https://foo.com/',
@ -78,9 +78,6 @@ class WebfingerTest(testutil.TestCase):
}, {
'rel': 'salmon',
'href': 'http://localhost/foo.com/salmon'
# }, {
# 'rel': 'http://ostatus.org/schema/1.0/subscribe',
# 'template': 'https://mastodon.technology/authorize_follow?acct={uri}'
}]
}

Wyświetl plik

@ -4,11 +4,6 @@ https://webfinger.net/
https://tools.ietf.org/html/rfc7033
Largely based on webfinger-unofficial/user.py.
TODO: test:
* /.well-known/webfinger
* acct: URI handling
* user URL that redirects
"""
import datetime
import logging
@ -152,6 +147,13 @@ Couldn't find a representative h-card (http://microformats.org/wiki/representati
class WebfingerHandler(UserHandler):
"""Handles Webfinger requests.
https://webfinger.net/
Supports both JRD and XRD; defaults to JRD.
https://tools.ietf.org/html/rfc7033#section-4
"""
def template_vars(self):
resource = util.get_required_param(self, 'resource')
try: