Skip to content

Commit

Permalink
Update unit test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Cataldo committed Jan 4, 2024
1 parent 95c5ef2 commit fa4a531
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 10 additions & 1 deletion mongo/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,15 @@ func initListTestFindOneAndUpdate() []testFindOneAndUpdate {
durationTimeout: 5 * time.Second,
wantErr: true,
},
{
name: "failed update",
filter: bson.D{{"_id", objectId}},
update: bson.M{"name": "Updated Test Name"},
dest: &testStruct{},
option: initOptionFindOneAndUpdate(),
durationTimeout: 5 * time.Second,
wantErr: true,
},
}
}

Expand Down Expand Up @@ -1865,7 +1874,7 @@ func initOptionInsertMany() option.InsertMany {
SetBypassDocumentValidation(true).
SetForceRecreateSession(true).
SetComment("comment insert golang unit test").
SetDisableAutoCloseSession(false).
SetDisableAutoCloseSession(true).
SetDisableAutoRollback(false)
}

Expand Down
1 change: 0 additions & 1 deletion mongo/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ func TestTemplateInsertMany(t *testing.T) {
} else if err != nil {
t.Log("err expected:", err)
}
_ = mongoTemplate.CloseSession(ctx, err != nil)
})
}
}
Expand Down

0 comments on commit fa4a531

Please sign in to comment.