I have tried to fix the bug mentioned in Issue 111
I have also added an fixes to pass special characters (i.e. "#" in "C#") to the github api endpoint in a query parameter.
Checklist
[x] My code is properly formatted using the latest black
I have tackled the error caused by gtrending requests by creating a mapping variable which checks the language passed in by the user.
For example, in,
-l csharp -d day
The language "csharp" will be checked in the mapping values. It it is present in any list we replace the language by its key (i.e. c#).
PROBLEM: (Test case failure)
assert repo["language"].lower() == language.lower()
This assertion is in method "test_search_language" in "tests/test_search.py".
This is because the response contains "c++" as language and the request of user comes with "cpp" as input,
Enhancements
I have also added a changes language query parameter which is passed to github api endpoint so it accepts special characters like "#" (Since special characters need to be encoded before it is passed in as query parameter)
[f"+language:{language}" for language in languages]
[f"+language:{requests.utils.quote(language)}" for language in languages]
I have tried to fix the bug mentioned in Issue 111 I have also added an fixes to pass special characters (i.e. "#" in "C#") to the github api endpoint in a query parameter.
Checklist
Description
-l csharp -d day
The language "csharp" will be checked in the mapping values. It it is present in any list we replace the language by its key (i.e. c#).assert repo["language"].lower() == language.lower()
This assertion is in method "test_search_language" in "tests/test_search.py". This is because the response contains "c++" as language and the request of user comes with "cpp" as input,Do let me know your thoughts on these changes.