Detect invalid usernames before performing methods
Before performing some methods we should first detect if the requested username for the query is valid or not, and raise an InvalidUsername Error.
E.g. Any username not satisfying these rules will be invalid usernames on GitHub.
But when we do:
>>> from IGitt.GitHub.GitHubUser import GitHubUser
>>> user = GitHubUser(GITHUB_TOKEN, 'greenkeeper[bot]')
>>> user.username
>>> 'greenkeeper[bot]'
It shouldn't return the user objects for invalid usernames.
Other methods to apply this functionality on, would be GitHub.raw_search
, e.g. if the query is commenter:sks444[bot] is:pr user:coala
should return invalid username.
And .get() and get_response()
methods when url contain invalid usernames, etc.