Example #1
0
 def test_xml_webfinger_is_parsed(self):
     result = parse_diaspora_webfinger(DIASPORA_WEBFINGER)
     assert result == {
         "hcard_url": "https://server.example/hcard/users/0123456789abcdef"
     }
Example #2
0
 def test_returns_default_if_parsing_fails(self):
     result = parse_diaspora_webfinger("not a valid doc")
     assert result == {"hcard_url": None}
Example #3
0
 def test_json_webfinger_is_parsed(self):
     result = parse_diaspora_webfinger(DIASPORA_WEBFINGER_JSON)
     assert result == {
         "hcard_url":
         "https://example.org/hcard/users/7dba7ca01d64013485eb3131731751e9"
     }