17 lines
491 B
Go
17 lines
491 B
Go
package service
|
|
|
|
import "testing"
|
|
|
|
func TestHarborHelpersErrorPaths(t *testing.T) {
|
|
app := &App{settings: Settings{HarborRegistry: "reg/", HarborProject: "proj"}}
|
|
if got := app.artifactRepo("node"); got != "reg/proj/node" {
|
|
t.Fatalf("artifactRepo = %q", got)
|
|
}
|
|
if err := app.ensureHarborProject(); err == nil {
|
|
t.Fatal("expected missing creds error")
|
|
}
|
|
if err := app.pruneHarborArtifacts("node", 1); err == nil {
|
|
t.Fatal("expected pruneHarborArtifacts to require API base")
|
|
}
|
|
}
|