MCPcopy Create free account
hub / github.com/amitsaha/gitbackup / TestHandleValidateConfigMissingEnvVar

Function TestHandleValidateConfigMissingEnvVar

config_file_test.go:132–144  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

130}
131
132func TestHandleValidateConfigMissingEnvVar(t *testing.T) {
133 tmpDir := t.TempDir()
134 configPath := filepath.Join(tmpDir, defaultConfigFile)
135
136 // Write a valid gitlab config but don't set GITLAB_TOKEN
137 os.WriteFile(configPath, []byte("service: gitlab\ngitlab:\n project_visibility: internal\n project_membership_type: all\n"), 0644)
138 os.Unsetenv("GITLAB_TOKEN")
139
140 err := handleValidateConfig(configPath)
141 if err == nil {
142 t.Fatal("Expected validation error for missing GITLAB_TOKEN")
143 }
144}
145
146func TestInitConfigWithConfigFile(t *testing.T) {
147 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 1

handleValidateConfigFunction · 0.85

Tested by

no test coverage detected