Skip to content

Commit

Permalink
using testify for tests and unexporting someTool
Browse files Browse the repository at this point in the history
  • Loading branch information
Amrit Singh committed Jan 29, 2025
1 parent d78ff1f commit 0d2108a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/tool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ func TestToolWithTestify(t *testing.T) {

// Test when the tool exists
t.Run("Tool Exists in Kit", func(t *testing.T) {
t.Parallel()
result, err := kit.UseTool(context.Background(), "An awesome tool", "test")
assert.NoError(t, err)
assert.Equal(t, "test", result)
})

// Test when the tool does not exist
t.Run("Tool Does Not Exist in Kit", func(t *testing.T) {
t.Parallel()
_, err := kit.UseTool(context.Background(), "A tool that does not exist", "test")
assert.Error(t, err)
assert.Equal(t, ErrInvalidTool, err.Error())
Expand Down

0 comments on commit 0d2108a

Please sign in to comment.