-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpublisher_test.go
More file actions
30 lines (28 loc) · 869 Bytes
/
publisher_test.go
File metadata and controls
30 lines (28 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package server
import (
"testing"
)
func TestIsPublishableApp(t *testing.T) {
s := &Server{nil, nil}
appName := "go_v2.web.1"
if !s.IsPublishableApp(appName) {
t.Errorf("%s should be publishable", appName)
}
badAppName := "go_v2"
if s.IsPublishableApp(badAppName) {
t.Errorf("%s should not be publishable", badAppName)
}
// publisher assumes that an app name of "test" with a null etcd client has v3 running
oldVersion := "ceci-nest-pas-une-app_v2.web.1"
if s.IsPublishableApp(oldVersion) {
t.Errorf("%s should not be publishable", oldVersion)
}
currentVersion := "ceci-nest-pas-une-app_v3.web.1"
if !s.IsPublishableApp(currentVersion) {
t.Errorf("%s should be publishable", currentVersion)
}
futureVersion := "ceci-nest-pas-une-app_v4.web.1"
if !s.IsPublishableApp(futureVersion) {
t.Errorf("%s should be publishable", futureVersion)
}
}