Skip to content

Commit

Permalink
ns: Use Error instead of Fatal
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Gregoire committed Feb 22, 2019
1 parent 6ab0587 commit ed4d99e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/networkserver/grpc_deviceregistry_test.go
Expand Up @@ -65,8 +65,8 @@ func TestDeviceRegistryGet(t *testing.T) {
})
},
GetByIDFunc: func(ctx context.Context, appID ttnpb.ApplicationIdentifiers, devID string, paths []string) (*ttnpb.EndDevice, error) {
test.MustTFromContext(ctx).Fatal("GetByIDFunc must not be called")
panic("Unreachable")
test.MustTFromContext(ctx).Errorf("GetByIDFunc must not be called")
return nil, errors.New("GetByIDFunc must not be called")
},
Request: &ttnpb.GetEndDeviceRequest{
EndDeviceIdentifiers: ids,
Expand Down Expand Up @@ -208,8 +208,8 @@ func TestDeviceRegistrySet(t *testing.T) {
})
},
SetByIDFunc: func(ctx context.Context, appID ttnpb.ApplicationIdentifiers, devID string, gets []string, f func(*ttnpb.EndDevice) (*ttnpb.EndDevice, []string, error)) (*ttnpb.EndDevice, error) {
test.MustTFromContext(ctx).Fatal("SetByIDFunc must not be called")
panic("Unreachable")
test.MustTFromContext(ctx).Errorf("SetByIDFunc must not be called")
return nil, errors.New("SetByIDFunc must not be called")
},
Request: &ttnpb.SetEndDeviceRequest{
Device: ttnpb.EndDevice{
Expand Down Expand Up @@ -424,8 +424,8 @@ func TestDeviceRegistryDelete(t *testing.T) {
})
},
SetByIDFunc: func(ctx context.Context, appID ttnpb.ApplicationIdentifiers, devID string, gets []string, f func(*ttnpb.EndDevice) (*ttnpb.EndDevice, []string, error)) (*ttnpb.EndDevice, error) {
test.MustTFromContext(ctx).Fatal("SetByIDFunc must not be called")
panic("Unreachable")
test.MustTFromContext(ctx).Errorf("SetByIDFunc must not be called")
return nil, errors.New("SetByIDFunc must not be called")
},
Request: deepcopy.Copy(&ids).(*ttnpb.EndDeviceIdentifiers),
ErrorAssertion: func(t *testing.T, err error) bool {
Expand Down

0 comments on commit ed4d99e

Please sign in to comment.