| 356 | } |
| 357 | |
| 358 | func TestRunImport_UnknownSource(t *testing.T) { |
| 359 | dir := t.TempDir() |
| 360 | |
| 361 | cfg := ImportConfig{ |
| 362 | SourceName: "nonexistent", |
| 363 | SourceCfg: SourceConfig{Name: "nonexistent"}, |
| 364 | OutputDir: filepath.Join(dir, "tasks"), |
| 365 | ScanDir: dir, |
| 366 | } |
| 367 | |
| 368 | _, err := RunImport(cfg) |
| 369 | if err == nil { |
| 370 | t.Fatal("expected error for unknown source") |
| 371 | } |
| 372 | if !strings.Contains(err.Error(), "unknown source") { |
| 373 | t.Errorf("expected 'unknown source' in error, got: %v", err) |
| 374 | } |
| 375 | } |
| 376 | |
| 377 | func TestRunImport_FetchError(t *testing.T) { |
| 378 | sourceName := "test-import-fetcherr" |