(t *testing.T)
| 218 | } |
| 219 | |
| 220 | func TestGetAPIKeyFromHelperWithCache_NoCaching(t *testing.T) { |
| 221 | overrideCredStore(t) |
| 222 | // Test with refreshInterval = 0 (no caching) |
| 223 | command := "echo 'test-key-no-cache'" |
| 224 | |
| 225 | key1, err := GetAPIKeyFromHelperWithCache(context.Background(), command, 0) |
| 226 | if err != nil { |
| 227 | t.Fatalf("GetAPIKeyFromHelperWithCache() error = %v", err) |
| 228 | } |
| 229 | if key1 != "test-key-no-cache" { |
| 230 | t.Errorf("Expected 'test-key-no-cache', got %q", key1) |
| 231 | } |
| 232 | |
| 233 | // Second call should also execute (no caching) |
| 234 | key2, err := GetAPIKeyFromHelperWithCache(context.Background(), command, 0) |
| 235 | if err != nil { |
| 236 | t.Fatalf("GetAPIKeyFromHelperWithCache() error = %v", err) |
| 237 | } |
| 238 | if key2 != "test-key-no-cache" { |
| 239 | t.Errorf("Expected 'test-key-no-cache', got %q", key2) |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | func TestGetAPIKeyFromHelperWithCache_WithCaching(t *testing.T) { |
| 244 | overrideCredStore(t) |
nothing calls this directly
no test coverage detected