Skip to content

Commit

Permalink
Test for formating http link header #451
Browse files Browse the repository at this point in the history
  • Loading branch information
karlcow authored and Mike Taylor committed Feb 28, 2015
1 parent fbbabb5 commit 977fa0d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ def test_parse_http_link_headers(self):
link_header = '<https://api.github.com/repositories/17914657/issues?page=2>; rel="next", <https://api.github.com/repositories/17914657/issues?page=11>; rel="last"'
self.assertEqual(parse_link_header(link_header), parsed_headers)

def test_format_http_link_headers(self):
'''Test HTTP Links formating.'''
parsed_headers = [{'link': 'https://api.github.com/repositories/17914657/issues?page=2', 'rel': 'next'}, {'link': 'https://api.github.com/repositories/17914657/issues?page=11', 'rel': 'last'}]
link_header = '<https://api.github.com/repositories/17914657/issues?page=2>; rel="next", <https://api.github.com/repositories/17914657/issues?page=11>; rel="last"'
self.assertEqual(format_link_header(parsed_headers), link_header)

if __name__ == '__main__':
unittest.main()

0 comments on commit 977fa0d

Please sign in to comment.