Skip to content

Commit

Permalink
rand feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanlookpotts committed Jan 29, 2025
1 parent f29a79b commit 1ff98bc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
7 changes: 7 additions & 0 deletions components/button/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ import (
"go.viam.com/rdk/testutils/inject"
)

const (
testButtonName = "button1"
testButtonName2 = "button2"
failButtonName = "button3"
missingButtonName = "button4"
)

func TestClient(t *testing.T) {
logger := logging.NewTestLogger(t)
listener1, err := net.Listen("tcp", "localhost:0")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package button_test
package fake_test

import (
"context"
Expand All @@ -12,13 +12,6 @@ import (
"go.viam.com/rdk/resource"
)

const (
testButtonName = "button1"
testButtonName2 = "button2"
failButtonName = "button3"
missingButtonName = "button4"
)

func TestPush(t *testing.T) {
logger := logging.NewTestLogger(t)
cfg := resource.Config{
Expand Down
4 changes: 2 additions & 2 deletions components/button/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ func (s *serviceServer) Push(ctx context.Context, req *pb.PushRequest) (*pb.Push
func (s *serviceServer) DoCommand(ctx context.Context,
req *commonpb.DoCommandRequest,
) (*commonpb.DoCommandResponse, error) {
gripper, err := s.coll.Resource(req.GetName())
button, err := s.coll.Resource(req.GetName())
if err != nil {
return nil, err
}
return protoutils.DoFromResourceServer(ctx, gripper, req)
return protoutils.DoFromResourceServer(ctx, button, req)
}
2 changes: 1 addition & 1 deletion components/button/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestServer(t *testing.T) {

_, err = buttonServer.Push(context.Background(), &pb.PushRequest{Name: testButtonName2})
test.That(t, err, test.ShouldNotBeNil)
test.That(t, err.Error(), test.ShouldContainSubstring, errCantPush.Error())
test.That(t, err, test.ShouldBeError, errCantPush)
test.That(t, buttonPushed, test.ShouldEqual, testButtonName2)
})

Expand Down

0 comments on commit 1ff98bc

Please sign in to comment.