forked from fujiwara/stretcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aws_test.go
38 lines (31 loc) · 980 Bytes
/
aws_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
package stretcher_test
import (
"testing"
"github.com/fujiwara/stretcher"
)
func TestLoadAWSConfigFile(t *testing.T) {
stretcher.LoadAWSConfigFile("test/aws.config", "default")
if stretcher.AWSAuth.AccessKey != "DZECFQXRXAPORD3VDEKG" {
t.Errorf("access_key mismatch")
}
if stretcher.AWSAuth.SecretKey != "NEZ5eNlmtE6ZjEQlj/uJpsog2ndjPX+uej1CHMYH" {
t.Errorf("secret_key mismatch")
}
if stretcher.AWSRegion.Name != "ap-northeast-1" {
t.Errorf("region mismatch")
}
stretcher.LoadAWSConfigFile("test/aws.config", "dummy")
if stretcher.AWSAuth.AccessKey != "AAAAAAAAAAAAAAAAAAAA" {
t.Errorf("access_key mismatch")
}
if stretcher.AWSAuth.SecretKey != "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" {
t.Errorf("secret_key mismatch")
}
if stretcher.AWSRegion.Name != "us-east-1" {
t.Errorf("region mismatch")
}
err := stretcher.LoadAWSConfigFile("test/aws.config", "not_found")
if err == nil {
t.Error("load not_found profile must be error", err)
}
}