class TestWebFingerResponse(unittest.TestCase): def setUp(self): jrd = { "subject": "acct:[email protected]", "properties": { "http://schema.org/name": "Eric Mill" }, "links": [ { "rel": "http://webfinger.net/rel/profile-page", "href": "https://konklone.com" }, { "rel": "http://webfinger.net/rel/avatar", "href": "https://secure.gravatar.com/avatar/ac3399caecce27cb19d381f61124539e.jpg?s=400" } ] } self.response = WebFingerResponse(jrd) def test_subject(self): self.assertEqual(self.response.subject, 'acct:[email protected]') def test_rel(self): self.assertEqual(self.response.rel('http://webfinger.net/rel/profile-page'), 'https://konklone.com') def test_invalid_rel(self): self.assertEqual(self.response.rel(''), None)
def setUp(self): jrd = { "subject": "acct:[email protected]", "properties": { "http://schema.org/name": "Eric Mill" }, "links": [ { "rel": "http://webfinger.net/rel/profile-page", "href": "https://konklone.com" }, { "rel": "http://webfinger.net/rel/avatar", "href": "https://secure.gravatar.com/avatar/ac3399caecce27cb19d381f61124539e.jpg?s=400" } ] } self.response = WebFingerResponse(jrd)