Skip to content

Commit 977fa0d

Browse files
karlcowMike Taylor
authored and
Mike Taylor
committed
Test for formating http link header #451
1 parent fbbabb5 commit 977fa0d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/test_urls.py

+5
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ def test_parse_http_link_headers(self):
112112
link_header = '<https://api.github.com/repositories/17914657/issues?page=2>; rel="next", <https://api.github.com/repositories/17914657/issues?page=11>; rel="last"'
113113
self.assertEqual(parse_link_header(link_header), parsed_headers)
114114

115+
def test_format_http_link_headers(self):
116+
'''Test HTTP Links formating.'''
117+
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'}]
118+
link_header = '<https://api.github.com/repositories/17914657/issues?page=2>; rel="next", <https://api.github.com/repositories/17914657/issues?page=11>; rel="last"'
119+
self.assertEqual(format_link_header(parsed_headers), link_header)
115120

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

0 commit comments

Comments
 (0)