-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathappsettings_test.go
More file actions
46 lines (36 loc) · 956 Bytes
/
appsettings_test.go
File metadata and controls
46 lines (36 loc) · 956 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package api
import (
"strings"
"testing"
)
func TestAutoscaleString(t *testing.T) {
a := Autoscale{}
expected := strings.TrimSpace(`Min Replicas: 0
Max Replicas: 0
CPU: 0%`)
if strings.TrimSpace(a.String()) != expected {
t.Errorf("Expected:\n\n%s\n\nGot:\n\n%s", expected, a.String())
}
a2 := Autoscale{
Min: 3,
Max: 8,
CPUPercent: 40,
}
expected2 := strings.TrimSpace(`Min Replicas: 3
Max Replicas: 8
CPU: 40%`)
if strings.TrimSpace(a2.String()) != expected2 {
t.Errorf("Expected:\n\n%s\n\nGot:\n\n%s", expected2, a2.String())
}
}
func TestLabelsString(t *testing.T) {
data := Labels{
"git_repo": "https://github.com/deis/controller-sdk-go",
"team": "deis",
}
expected := strings.TrimSpace(`git_repo: https://github.com/deis/controller-sdk-go
team: deis`)
if strings.TrimSpace(data.String()) != expected {
t.Errorf("Expected:\n\n%s\n\nGot:\n\n%s", expected, data.String())
}
}