Skip to content

Commit

Permalink
fix: unit test fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Matrix86 committed Mar 19, 2021
1 parent 23df132 commit bb7ede0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
14 changes: 8 additions & 6 deletions dropbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ func TestDropboxWatcher_Start(t *testing.T) {
Entries: []files.IsMetadata{files.NewFileMetadata("name", "Id", modtime, modtime, "1", 120)},
Cursor: "",
HasMore: false,
}, nil)
},
nil,
)

dw.sync()
dw.sync(false)
event = <-dw.GetEvents()

if event.Key != "name" {
Expand All @@ -109,7 +111,7 @@ func TestDropboxWatcher_Start(t *testing.T) {
Cursor: "",
HasMore: false,
}, nil)
dw.sync()
dw.sync(false)

// File modified : size changed
m.EXPECT().ListFolder(arg).Return(
Expand All @@ -118,7 +120,7 @@ func TestDropboxWatcher_Start(t *testing.T) {
Cursor: "",
HasMore: false,
}, nil)
dw.sync()
dw.sync(false)
event = <-dw.GetEvents()

if event.Key != "name" {
Expand All @@ -134,7 +136,7 @@ func TestDropboxWatcher_Start(t *testing.T) {
Cursor: "",
HasMore: false,
}, nil)
dw.sync()
dw.sync(false)
event = <-dw.GetEvents()

if event.Key != "name" {
Expand All @@ -150,7 +152,7 @@ func TestDropboxWatcher_Start(t *testing.T) {
Cursor: "",
HasMore: false,
}, nil)
dw.sync()
dw.sync(false)
event = <-dw.GetEvents()

if event.Key != "name" {
Expand Down
12 changes: 6 additions & 6 deletions s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func TestS3Watcher_Start(t *testing.T) {
// we need to overwrite the client after the call to SetConfig
sw.client = m

sw.sync()
sw.sync(false)

// wrong bucket
select {
Expand Down Expand Up @@ -166,7 +166,7 @@ func TestS3Watcher_Start(t *testing.T) {
nil,
)

sw.sync()
sw.sync(false)
select {
case event = <-d.GetEvents():
case <-time.After(1 * time.Second):
Expand Down Expand Up @@ -210,7 +210,7 @@ func TestS3Watcher_Start(t *testing.T) {
nil,
)

sw.sync()
sw.sync(false)
select {
case event = <-d.GetEvents():
case <-time.After(1 * time.Second):
Expand Down Expand Up @@ -252,7 +252,7 @@ func TestS3Watcher_Start(t *testing.T) {
tag,
nil,
)
sw.sync()
sw.sync(false)
select {
case event = <-d.GetEvents():
case <-time.After(1 * time.Second):
Expand Down Expand Up @@ -295,7 +295,7 @@ func TestS3Watcher_Start(t *testing.T) {
tag,
nil,
)
sw.sync()
sw.sync(false)
select {
case event = <-d.GetEvents():
case <-time.After(1 * time.Second):
Expand Down Expand Up @@ -323,7 +323,7 @@ func TestS3Watcher_Start(t *testing.T) {
},
)

sw.sync()
sw.sync(false)
select {
case event = <-d.GetEvents():
case <-time.After(1 * time.Second):
Expand Down

0 comments on commit bb7ede0

Please sign in to comment.