(t *testing.T)
| 728 | } |
| 729 | |
| 730 | func TestPrebuiltAndCustomTools(t *testing.T) { |
| 731 | t.Setenv("SQLITE_DATABASE", "\":memory:\"") |
| 732 | // Setup custom config |
| 733 | customContent := ` |
| 734 | kind: tool |
| 735 | name: custom_tool |
| 736 | type: http |
| 737 | source: my-http |
| 738 | method: GET |
| 739 | path: / |
| 740 | description: "A custom tool for testing" |
| 741 | --- |
| 742 | kind: source |
| 743 | name: my-http |
| 744 | type: http |
| 745 | baseUrl: http://example.com |
| 746 | ` |
| 747 | customFile := filepath.Join(t.TempDir(), "custom.yaml") |
| 748 | if err := os.WriteFile(customFile, []byte(customContent), 0644); err != nil { |
| 749 | t.Fatal(err) |
| 750 | } |
| 751 | |
| 752 | // Tool Conflict File |
| 753 | // SQLite prebuilt has a tool named 'list_tables' |
| 754 | toolConflictContent := ` |
| 755 | kind: tool |
| 756 | name: list_tables |
| 757 | type: http |
| 758 | source: my-http |
| 759 | method: GET |
| 760 | path: / |
| 761 | description: "Conflicting tool" |
| 762 | --- |
| 763 | kind: source |
| 764 | name: my-http |
| 765 | type: http |
| 766 | baseUrl: http://example.com |
| 767 | ` |
| 768 | toolConflictFile := filepath.Join(t.TempDir(), "tool_conflict.yaml") |
| 769 | if err := os.WriteFile(toolConflictFile, []byte(toolConflictContent), 0644); err != nil { |
| 770 | t.Fatal(err) |
| 771 | } |
| 772 | |
| 773 | // Source Conflict File |
| 774 | // SQLite prebuilt has a source named 'sqlite-source' |
| 775 | sourceConflictContent := ` |
| 776 | kind: source |
| 777 | name: sqlite-source |
| 778 | type: http |
| 779 | baseUrl: http://example.com |
| 780 | --- |
| 781 | kind: tool |
| 782 | name: dummy_tool |
| 783 | type: http |
| 784 | source: sqlite-source |
| 785 | method: GET |
| 786 | path: / |
| 787 | description: "Dummy" |
nothing calls this directly
no test coverage detected