-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpush_test.go
51 lines (41 loc) · 887 Bytes
/
push_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 docker
import (
"os"
"testing"
"github.com/rai-project/model"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
)
var testPushModel model.Push
type PushTestSuite struct {
suite.Suite
client *Client
}
func NewPushTestSuite(t *testing.T) (*PushTestSuite, error) {
client, err := NewClient(
Stdout(os.Stdout),
Stderr(os.Stderr),
)
assert.NoError(t, err)
if err != nil {
return nil, err
}
return &PushTestSuite{
client: client,
}, nil
}
func (suite *PushTestSuite) TestAuthentication() {
t := suite.T()
client := suite.client
err := client.ImagePush(testPushModel.ImageName, testPushModel)
if !assert.NoError(t, err, "Failed to push image") {
return
}
}
func XXTestPush(t *testing.T) {
c, err := NewPushTestSuite(t)
if !assert.NoError(t, err, "Failed to create docker Push test suite") {
return
}
suite.Run(t, c)
}