Cover all code paths in search_commits (#2087)

The search_commits method was only very lightly tested, meaning over
half of it was not covered. Write another test case, covering all code
paths.
This commit is contained in:
Steve Kowalik
2021-10-22 08:39:31 +11:00
committed by GitHub
parent 93b92cd2fc
commit f1faf941ec
3 changed files with 23 additions and 7 deletions
+3 -7
View File
@@ -598,19 +598,15 @@ class Github:
"""
assert isinstance(query, str), query
url_parameters = dict()
if (
sort is not github.GithubObject.NotSet
): # pragma no branch (Should be covered)
if sort is not github.GithubObject.NotSet:
assert sort in ("author-date", "committer-date"), sort
url_parameters["sort"] = sort
if (
order is not github.GithubObject.NotSet
): # pragma no branch (Should be covered)
if order is not github.GithubObject.NotSet:
assert order in ("asc", "desc"), order
url_parameters["order"] = order
query_chunks = []
if query: # pragma no branch (Should be covered)
if query:
query_chunks.append(query)
for qualifier, value in qualifiers.items():