def test_accepts_valid_urls(self, url): api = github_plugin.GitHubAPI(url, TOKEN, ORG_NAME, USER) assert isinstance(api, plug.PlatformAPI)
def test_raises_on_empty_user_arg(self): with pytest.raises(TypeError) as exc_info: github_plugin.GitHubAPI(BASE_URL, TOKEN, ORG_NAME, "") assert "argument 'user' must not be empty" in str(exc_info.value)
def test_raises_when_url_is_bad(self, url): with pytest.raises(plug.PlugError) as exc_info: github_plugin.GitHubAPI(url, TOKEN, ORG_NAME, USER) assert ("invalid base url, should either be https://api.github.com or " "end with '/api/v3'" in str(exc_info.value))
def api(happy_github, organization, no_teams): return github_plugin.GitHubAPI(BASE_URL, TOKEN, ORG_NAME, USER)