def test_stringification_no_title(self):
     field = LinkHeaderField.from_string(LINK_HEADER_LAST)
     self.assertEqual(str(field), LINK_HEADER_LAST)
 def test_stringification(self):
     field = LinkHeaderField.from_string(LINK_HEADER_NEXT)
     self.assertEqual(str(field), LINK_HEADER_NEXT)
 def test_sad_no_rel(self):
     self.assertRaises(
         MalformedLinkHeader,
         lambda: LinkHeaderField.from_string("<http://google.com>; meh=I am still malformed"))
 def test_sad_no_url(self):
     self.assertRaises(
         MalformedLinkHeader,
         lambda: LinkHeaderField.from_string('Oh f**k.. I am malformed; rel="next"'))
 def test_title(self):
     field = LinkHeaderField.from_string(LINK_HEADER_NEXT)
     self.assertEqual(field.title, "The Next Page")
 def test_rel(self):
     field = LinkHeaderField.from_string(LINK_HEADER_LAST)
     self.assertEqual(field.rel, LinkHeaderRel.last)
 def test_url(self):
     field = LinkHeaderField.from_string(LINK_HEADER_LAST)
     self.assertEqual(field.url, 'https://api.github.com/search/code?q=addClass+user%3Amozilla&page=34')