mirror of
https://github.com/MedzikUser/go-github-selfupdate.git
synced 2024-08-15 03:25:29 +00:00
test creating an updater when token is not set
This commit is contained in:
parent
2bc49bb7b5
commit
a384a5b5c8
1 changed files with 12 additions and 0 deletions
|
@ -19,6 +19,18 @@ func TestGitHubTokenEnv(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGitHubTokenIsNotSet(t *testing.T) {
|
||||||
|
token := os.Getenv("GITHUB_TOKEN")
|
||||||
|
if token != "" {
|
||||||
|
defer os.Setenv("GITHUB_TOKEN", token)
|
||||||
|
}
|
||||||
|
os.Setenv("GITHUB_TOKEN", "")
|
||||||
|
_ = DefaultUpdater()
|
||||||
|
if _, err := NewUpdater(Config{}); err != nil {
|
||||||
|
t.Error("Failed to initialize updater with empty config")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestGitHubEnterpriseClient(t *testing.T) {
|
func TestGitHubEnterpriseClient(t *testing.T) {
|
||||||
url := "https://github.company.com/api/v3/"
|
url := "https://github.company.com/api/v3/"
|
||||||
up, err := NewUpdater(Config{APIToken: "hogehoge", EnterpriseBaseURL: url})
|
up, err := NewUpdater(Config{APIToken: "hogehoge", EnterpriseBaseURL: url})
|
||||||
|
|
Loading…
Reference in a new issue