Skip to content

Commit b2d05a8

Browse files
karlcowMike Taylor
authored and
Mike Taylor
committed
#451 fixing tests syntax to conform
1 parent 4146df1 commit b2d05a8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/test_helpers.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
GITHUB_SEARCH_LINK_HEADER = '<https://api.github.com/search/issues?q=taco&page=2>; rel="next", <https://api.github.com/search/issues?q=taco&page=26>; rel="last"'
2929
REWRITTEN_ISSUES_LINK_HEADER = '</api/issues?per_page=50&page=3>; rel="next", </api/issues?per_page=50&page=4>; rel="last", </api/issues?per_page=50&page=1>; rel="first", </api/issues?per_page=50&page=1>; rel="prev"'
3030
REWRITTEN_SEARCH_LINK_HEADER = '</api/issues/search?q=taco&page=2>; rel="next", </api/issues/search?q=taco&page=26>; rel="last"'
31+
PARSED_LINKED_HEADERS = [{'link': 'https://api.github.com/repositories/17839063/issues?per_page=50&page=3', 'rel': 'next'}, {'link': 'https://api.github.com/repositories/17839063/issues?per_page=50&page=4', 'rel': 'last'}, {'link': 'https://api.github.com/repositories/17839063/issues?per_page=50&page=1', 'rel': 'first'}, {'link': 'https://api.github.com/repositories/17839063/issues?per_page=50&page=1', 'rel': 'prev'}]
3132

3233

3334
class TestHelpers(unittest.TestCase):
@@ -99,14 +100,14 @@ def test_normalize_api_params_ignores_unknown_params(self):
99100

100101
def test_parse_http_link_headers(self):
101102
'''Test HTTP Links parsing for GitHub only.'''
102-
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'}]
103-
link_header = '<https://api.github.com/repositories/17914657/issues?page=2>; rel="next", <https://api.github.com/repositories/17914657/issues?page=11>; rel="last"'
103+
link_header = GITHUB_ISSUES_LINK_HEADER
104+
parsed_headers = PARSED_LINKED_HEADERS
104105
self.assertEqual(parse_link_header(link_header), parsed_headers)
105106

106107
def test_format_http_link_headers(self):
107108
'''Test HTTP Links formating.'''
108-
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'}]
109-
link_header = '<https://api.github.com/repositories/17914657/issues?page=2>; rel="next", <https://api.github.com/repositories/17914657/issues?page=11>; rel="last"'
109+
parsed_headers = PARSED_LINKED_HEADERS
110+
link_header = GITHUB_ISSUES_LINK_HEADER
110111
self.assertEqual(format_link_header(parsed_headers), link_header)
111112

112113
if __name__ == '__main__':

0 commit comments

Comments
 (0)