introduce a test for link headers.

This commit is contained in:
Steve Klabnik
2013-01-23 20:31:05 -05:00
parent 0af8ff9405
commit ccea28db07
+5
View File
@@ -265,6 +265,11 @@ class RequestsTestCase(unittest.TestCase):
self.assertEqual(r.status_code, 200)
self.assertTrue(b"text/py-content-type" in r.request.body)
def test_links(self):
url = 'https://api.github.com/users/kennethreitz/repos?page=1&per_page=10'
r = requests.head(url=url)
self.assertEqual(r.links['next']['rel'], 'next')
if __name__ == '__main__':
unittest.main()