mirror of
https://github.com/goharbor/harbor.git
synced 2024-06-26 14:55:06 +02:00
- use unified proxy handler to handle all the proxy traffic - define interfaces for the handlers - implement the interface at chart controller level - refactor UT cases - update other related reference code Signed-off-by: Steven Zou <szou@vmware.com>
22 lines
371 B
Go
22 lines
371 B
Go
package chartserver
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
// Test controller
|
|
func TestController(t *testing.T) {
|
|
s, c, err := createMockObjects()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
defer s.Close()
|
|
|
|
prefix := c.APIPrefix("fake")
|
|
expected := fmt.Sprintf("%s/api/%s/charts", s.URL, "fake")
|
|
if prefix != expected {
|
|
t.Fatalf("expect '%s' but got '%s'", expected, prefix)
|
|
}
|
|
}
|