def test_params_invalid_api_token(self): old_env = os.environ os.environ = {} with pytest.raises(Exception) as exc_info: gitdl.get_params() os.environ = old_env assert str(exc_info.value) == "GITHUB_API_TOKEN not found"
def test_params_valid_api_token(self): API_TOKEN = os.environ.get("GITHUB_API_TOKEN") assert gitdl.get_params(API_TOKEN).get('API_TOKEN') == \ os.environ.get("GITHUB_API_TOKEN")
def test_params_invalid_api_token(self): API_TOKEN = os.environ.get("GITDL") with pytest.raises(Exception) as exc_info: gitdl.get_params(API_TOKEN) assert str(exc_info.value) == "GITHUB_API_TOKEN not found"
def test_params_valid_api_token(self): old_env = os.environ os.environ = {"GITHUB_API_TOKEN": "key123"} assert gitdl.get_params().get('API_TOKEN') == \ os.environ.get("GITHUB_API_TOKEN") os.environ = old_env