summaryrefslogtreecommitdiff
path: root/internal/config/config_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config/config_test.go')
-rw-r--r--internal/config/config_test.go27
1 files changed, 3 insertions, 24 deletions
diff --git a/internal/config/config_test.go b/internal/config/config_test.go
index 0722825..b436e93 100644
--- a/internal/config/config_test.go
+++ b/internal/config/config_test.go
@@ -15,33 +15,22 @@ func TestConfigValidate(t *testing.T) {
{
name: "valid config",
cfg: Config{
- TodoistAPIKey: "todoist-key",
- TrelloAPIKey: "trello-key",
- TrelloToken: "trello-token",
- },
- wantErr: false,
- },
- {
- name: "missing todoist key",
- cfg: Config{
TrelloAPIKey: "trello-key",
TrelloToken: "trello-token",
},
- wantErr: true,
+ wantErr: false,
},
{
name: "missing trello key",
cfg: Config{
- TodoistAPIKey: "todoist-key",
- TrelloToken: "trello-token",
+ TrelloToken: "trello-token",
},
wantErr: true,
},
{
name: "missing trello token",
cfg: Config{
- TodoistAPIKey: "todoist-key",
- TrelloAPIKey: "trello-key",
+ TrelloAPIKey: "trello-key",
},
wantErr: true,
},
@@ -242,14 +231,12 @@ func TestToDisplayTZ(t *testing.T) {
func TestLoad(t *testing.T) {
// Set up required env vars
- os.Setenv("TODOIST_API_KEY", "test-todoist-key")
os.Setenv("TRELLO_API_KEY", "test-trello-key")
os.Setenv("TRELLO_TOKEN", "test-trello-token")
os.Setenv("PORT", "9999")
os.Setenv("CACHE_TTL_MINUTES", "10")
os.Setenv("DEBUG", "true")
defer func() {
- os.Unsetenv("TODOIST_API_KEY")
os.Unsetenv("TRELLO_API_KEY")
os.Unsetenv("TRELLO_TOKEN")
os.Unsetenv("PORT")
@@ -262,9 +249,6 @@ func TestLoad(t *testing.T) {
t.Fatalf("Load failed: %v", err)
}
- if cfg.TodoistAPIKey != "test-todoist-key" {
- t.Errorf("Expected TodoistAPIKey 'test-todoist-key', got '%s'", cfg.TodoistAPIKey)
- }
if cfg.Port != "9999" {
t.Errorf("Expected Port '9999', got '%s'", cfg.Port)
}
@@ -278,11 +262,9 @@ func TestLoad(t *testing.T) {
func TestConfig_ClaudomatorURL_Default(t *testing.T) {
os.Unsetenv("CLAUDOMATOR_URL")
- os.Setenv("TODOIST_API_KEY", "test-todoist-key")
os.Setenv("TRELLO_API_KEY", "test-trello-key")
os.Setenv("TRELLO_TOKEN", "test-trello-token")
defer func() {
- os.Unsetenv("TODOIST_API_KEY")
os.Unsetenv("TRELLO_API_KEY")
os.Unsetenv("TRELLO_TOKEN")
}()
@@ -298,12 +280,10 @@ func TestConfig_ClaudomatorURL_Default(t *testing.T) {
func TestConfig_ClaudomatorURL_EnvOverride(t *testing.T) {
os.Setenv("CLAUDOMATOR_URL", "http://1.2.3.4:9000")
- os.Setenv("TODOIST_API_KEY", "test-todoist-key")
os.Setenv("TRELLO_API_KEY", "test-trello-key")
os.Setenv("TRELLO_TOKEN", "test-trello-token")
defer func() {
os.Unsetenv("CLAUDOMATOR_URL")
- os.Unsetenv("TODOIST_API_KEY")
os.Unsetenv("TRELLO_API_KEY")
os.Unsetenv("TRELLO_TOKEN")
}()
@@ -319,7 +299,6 @@ func TestConfig_ClaudomatorURL_EnvOverride(t *testing.T) {
func TestLoad_ValidationError(t *testing.T) {
// Clear required env vars to trigger validation error
- os.Unsetenv("TODOIST_API_KEY")
os.Unsetenv("TRELLO_API_KEY")
os.Unsetenv("TRELLO_TOKEN")