Code maintenance: Remove unneeded ctrl.Finish()

This commit is contained in:
Quentin McGaw
2020-12-29 01:04:07 +00:00
parent 7058373916
commit cdd1f87437
4 changed files with 0 additions and 9 deletions

View File

@@ -16,7 +16,6 @@ import (
func Test_Start(t *testing.T) {
t.Parallel()
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()
logger := mock_logging.NewMockLogger(mockCtrl)
logger.EXPECT().Info("starting unbound")
commander := mock_command.NewMockCommander(mockCtrl)
@@ -54,7 +53,6 @@ func Test_Version(t *testing.T) {
t.Run(name, func(t *testing.T) {
t.Parallel()
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()
commander := mock_command.NewMockCommander(mockCtrl)
commander.EXPECT().Run(context.Background(), "unbound", "-V").
Return(tc.runOutput, tc.runErr)

View File

@@ -31,7 +31,6 @@ func Test_generateUnboundConf(t *testing.T) {
IPv6: true,
}
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()
ctx := context.Background()
client := mock_network.NewMockClient(mockCtrl)
client.EXPECT().Get(ctx, string(constants.MaliciousBlockListHostnamesURL)).
@@ -233,7 +232,6 @@ func Test_buildBlocked(t *testing.T) {
t.Run(name, func(t *testing.T) {
t.Parallel()
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()
ctx := context.Background()
client := mock_network.NewMockClient(mockCtrl)
if tc.malicious.blocked {
@@ -287,7 +285,6 @@ func Test_getList(t *testing.T) {
t.Run(name, func(t *testing.T) {
t.Parallel()
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()
ctx := context.Background()
client := mock_network.NewMockClient(mockCtrl)
client.EXPECT().Get(ctx, "irrelevant_url").
@@ -392,7 +389,6 @@ func Test_buildBlockedHostnames(t *testing.T) {
t.Run(name, func(t *testing.T) {
t.Parallel()
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()
ctx := context.Background()
client := mock_network.NewMockClient(mockCtrl)
if tc.malicious.blocked {
@@ -510,7 +506,6 @@ func Test_buildBlockedIPs(t *testing.T) {
t.Run(name, func(t *testing.T) {
t.Parallel()
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()
ctx := context.Background()
client := mock_network.NewMockClient(mockCtrl)
if tc.malicious.blocked {

View File

@@ -56,7 +56,6 @@ func Test_UseDNSSystemWide(t *testing.T) {
t.Run(name, func(t *testing.T) {
t.Parallel()
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()
file := mock_os.NewMockFile(mockCtrl)
if tc.openErr == nil {

View File

@@ -70,7 +70,6 @@ func Test_downloadAndSave(t *testing.T) {
t.Run(name, func(t *testing.T) {
t.Parallel()
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()
ctx := context.Background()
logger := mock_logging.NewMockLogger(mockCtrl)