-
Notifications
You must be signed in to change notification settings - Fork 0
/
environ_test.go
51 lines (45 loc) · 1.43 KB
/
environ_test.go
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
47
48
49
50
51
package gcpen
import (
"os"
"testing"
)
const (
testProject = "test-project"
testGAEService = "test-gae-service"
testGAEVersion = "test-gae-version"
testRUNService = "test-run-service"
testRUNRevision = "test-run-revision"
)
func init() {
os.Setenv(EnvKeyGoogleCloudProject, testProject)
os.Setenv(EnvKeyGAEServiceName, testGAEService)
os.Setenv(EnvKeyGAEServiceVersion, testGAEVersion)
os.Setenv(EnvKeyRUNServiceName, testRUNService)
os.Setenv(EnvKeyRUNServiceRevision, testRUNRevision)
}
func TestEnviron(t *testing.T) {
Reload()
if ProjectID != testProject {
t.Fatalf("unexpected, expected: %s, actual: %#v", testProject, ProjectID)
}
// Deprecated
if ServiceName != testGAEService {
t.Fatalf("unexpected, expected: %s, actual: %#v", testGAEService, ServiceName)
}
// Deprecated
if ServiceVersion != testGAEVersion {
t.Fatalf("unexpected, expected: %s, actual: %#v", testGAEVersion, ServiceVersion)
}
if GAEServiceName != testGAEService {
t.Fatalf("unexpected, expected: %s, actual: %#v", testGAEService, GAEServiceName)
}
if GAEServiceVersion != testGAEVersion {
t.Fatalf("unexpected, expected: %s, actual: %#v", testGAEVersion, GAEServiceVersion)
}
if RUNServiceName != testRUNService {
t.Fatalf("unexpected, expected: %s, actual: %#v", testRUNService, RUNServiceName)
}
if RUNServiceRevision != testRUNRevision {
t.Fatalf("unexpected, expected: %s, actual: %#v", testRUNRevision, RUNServiceRevision)
}
}