1
0
Fork 0

Fix tests to accept entrypoints

This commit is contained in:
emile 2016-02-01 11:07:05 +01:00
parent c22598c8ff
commit 81cb00573f
No known key found for this signature in database
GPG key ID: D808B4C167352E59
14 changed files with 107 additions and 79 deletions

View file

@ -84,7 +84,8 @@ func TestMarathonLoadConfig(t *testing.T) {
},
expectedFrontends: map[string]*types.Frontend{
`frontend-test`: {
Backend: "backend-test",
Backend: "backend-test",
EntryPoints: []string{},
Routes: map[string]types.Route{
`route-host-test`: {
Rule: "Host",
@ -735,6 +736,36 @@ func TestMarathonGetPassHostHeader(t *testing.T) {
}
}
func TestMarathonGetEntryPoints(t *testing.T) {
provider := &Marathon{}
applications := []struct {
application marathon.Application
expected []string
}{
{
application: marathon.Application{},
expected: []string{},
},
{
application: marathon.Application{
Labels: map[string]string{
"traefik.frontend.entryPoints": "http,https",
},
},
expected: []string{"http", "https"},
},
}
for _, a := range applications {
actual := provider.getEntryPoints(a.application)
if !reflect.DeepEqual(actual, a.expected) {
t.Fatalf("expected %#v, got %#v", a.expected, actual)
}
}
}
func TestMarathonGetFrontendValue(t *testing.T) {
provider := &Marathon{
Domain: "docker.localhost",