Code maintenance: Remove unneeded ctrl.Finish()
This commit is contained in:
@@ -16,7 +16,6 @@ import (
|
|||||||
func Test_Start(t *testing.T) {
|
func Test_Start(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
mockCtrl := gomock.NewController(t)
|
mockCtrl := gomock.NewController(t)
|
||||||
defer mockCtrl.Finish()
|
|
||||||
logger := mock_logging.NewMockLogger(mockCtrl)
|
logger := mock_logging.NewMockLogger(mockCtrl)
|
||||||
logger.EXPECT().Info("starting unbound")
|
logger.EXPECT().Info("starting unbound")
|
||||||
commander := mock_command.NewMockCommander(mockCtrl)
|
commander := mock_command.NewMockCommander(mockCtrl)
|
||||||
@@ -54,7 +53,6 @@ func Test_Version(t *testing.T) {
|
|||||||
t.Run(name, func(t *testing.T) {
|
t.Run(name, func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
mockCtrl := gomock.NewController(t)
|
mockCtrl := gomock.NewController(t)
|
||||||
defer mockCtrl.Finish()
|
|
||||||
commander := mock_command.NewMockCommander(mockCtrl)
|
commander := mock_command.NewMockCommander(mockCtrl)
|
||||||
commander.EXPECT().Run(context.Background(), "unbound", "-V").
|
commander.EXPECT().Run(context.Background(), "unbound", "-V").
|
||||||
Return(tc.runOutput, tc.runErr)
|
Return(tc.runOutput, tc.runErr)
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ func Test_generateUnboundConf(t *testing.T) {
|
|||||||
IPv6: true,
|
IPv6: true,
|
||||||
}
|
}
|
||||||
mockCtrl := gomock.NewController(t)
|
mockCtrl := gomock.NewController(t)
|
||||||
defer mockCtrl.Finish()
|
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
client := mock_network.NewMockClient(mockCtrl)
|
client := mock_network.NewMockClient(mockCtrl)
|
||||||
client.EXPECT().Get(ctx, string(constants.MaliciousBlockListHostnamesURL)).
|
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.Run(name, func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
mockCtrl := gomock.NewController(t)
|
mockCtrl := gomock.NewController(t)
|
||||||
defer mockCtrl.Finish()
|
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
client := mock_network.NewMockClient(mockCtrl)
|
client := mock_network.NewMockClient(mockCtrl)
|
||||||
if tc.malicious.blocked {
|
if tc.malicious.blocked {
|
||||||
@@ -287,7 +285,6 @@ func Test_getList(t *testing.T) {
|
|||||||
t.Run(name, func(t *testing.T) {
|
t.Run(name, func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
mockCtrl := gomock.NewController(t)
|
mockCtrl := gomock.NewController(t)
|
||||||
defer mockCtrl.Finish()
|
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
client := mock_network.NewMockClient(mockCtrl)
|
client := mock_network.NewMockClient(mockCtrl)
|
||||||
client.EXPECT().Get(ctx, "irrelevant_url").
|
client.EXPECT().Get(ctx, "irrelevant_url").
|
||||||
@@ -392,7 +389,6 @@ func Test_buildBlockedHostnames(t *testing.T) {
|
|||||||
t.Run(name, func(t *testing.T) {
|
t.Run(name, func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
mockCtrl := gomock.NewController(t)
|
mockCtrl := gomock.NewController(t)
|
||||||
defer mockCtrl.Finish()
|
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
client := mock_network.NewMockClient(mockCtrl)
|
client := mock_network.NewMockClient(mockCtrl)
|
||||||
if tc.malicious.blocked {
|
if tc.malicious.blocked {
|
||||||
@@ -510,7 +506,6 @@ func Test_buildBlockedIPs(t *testing.T) {
|
|||||||
t.Run(name, func(t *testing.T) {
|
t.Run(name, func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
mockCtrl := gomock.NewController(t)
|
mockCtrl := gomock.NewController(t)
|
||||||
defer mockCtrl.Finish()
|
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
client := mock_network.NewMockClient(mockCtrl)
|
client := mock_network.NewMockClient(mockCtrl)
|
||||||
if tc.malicious.blocked {
|
if tc.malicious.blocked {
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ func Test_UseDNSSystemWide(t *testing.T) {
|
|||||||
t.Run(name, func(t *testing.T) {
|
t.Run(name, func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
mockCtrl := gomock.NewController(t)
|
mockCtrl := gomock.NewController(t)
|
||||||
defer mockCtrl.Finish()
|
|
||||||
|
|
||||||
file := mock_os.NewMockFile(mockCtrl)
|
file := mock_os.NewMockFile(mockCtrl)
|
||||||
if tc.openErr == nil {
|
if tc.openErr == nil {
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ func Test_downloadAndSave(t *testing.T) {
|
|||||||
t.Run(name, func(t *testing.T) {
|
t.Run(name, func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
mockCtrl := gomock.NewController(t)
|
mockCtrl := gomock.NewController(t)
|
||||||
defer mockCtrl.Finish()
|
|
||||||
|
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
logger := mock_logging.NewMockLogger(mockCtrl)
|
logger := mock_logging.NewMockLogger(mockCtrl)
|
||||||
|
|||||||
Reference in New Issue
Block a user