-
Notifications
You must be signed in to change notification settings - Fork 135
/
project_test.go
41 lines (35 loc) · 862 Bytes
/
project_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
package sls
import (
"os"
"testing"
"github.com/golang/glog"
"github.com/stretchr/testify/suite"
)
func TestProject(t *testing.T) {
suite.Run(t, new(ProjectTestSuite))
glog.Flush()
}
type ProjectTestSuite struct {
suite.Suite
endpoint string
accessKeyID string
accessKeySecret string
client Client
}
func (s *ProjectTestSuite) SetupTest() {
s.endpoint = os.Getenv("LOG_TEST_ENDPOINT")
s.accessKeyID = os.Getenv("LOG_TEST_ACCESS_KEY_ID")
s.accessKeySecret = os.Getenv("LOG_TEST_ACCESS_KEY_SECRET")
s.client = Client{
Endpoint: s.endpoint,
AccessKeyID: s.accessKeyID,
AccessKeySecret: s.accessKeySecret,
SecurityToken: "",
}
}
func (s *ProjectTestSuite) TestCheckProjectExist() {
projectName := "not-exist-project"
exist, err := s.client.CheckProjectExist(projectName)
s.Nil(err)
s.False(exist)
}