-
Notifications
You must be signed in to change notification settings - Fork 8
/
syncsession_test.go
43 lines (32 loc) · 1.07 KB
/
syncsession_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
package v3io
import (
"github.com/nuclio/logger"
"github.com/nuclio/zap"
"github.com/stretchr/testify/suite"
"testing"
)
type SyncSessionTestSuite struct {
suite.Suite
logger logger.Logger
context *Context
session *Session
}
func (suite *SyncSessionTestSuite) SetupTest() {
var err error
suite.logger, err = nucliozap.NewNuclioZapTest("test")
suite.context, err = NewContext(suite.logger, "<value>", 1)
suite.Require().NoError(err, "Failed to create context")
suite.session, err = suite.context.NewSession("iguazio", "<value>", "")
suite.Require().NoError(err, "Failed to create session")
}
func (suite *SyncSessionTestSuite) TestListAll() {
response, err := suite.session.Sync.ListAll()
suite.Require().NoError(err, "List All returned error")
output, ok := response.Output.(*ListAllOutput)
suite.Require().True(ok, "Should have been 'ListAllOutput' got %T", response.Output)
suite.Require().True(len(output.Buckets.Bucket) > 0, "Must have at least one bucket")
response.Release()
}
func TestSyncSession(t *testing.T) {
suite.Run(t, new(SyncSessionTestSuite))
}