77 "testing"
88)
99
10- func TestOfficialregistryImportCommand (t * testing.T ) {
10+ func TestMcpregistryImportCommand (t * testing.T ) {
1111 // Test server that serves the Garmin MCP example JSON
1212 testServer := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
1313 if r .Method != http .MethodGet {
@@ -69,43 +69,43 @@ func TestOfficialregistryImportCommand(t *testing.T) {
6969
7070 // Test the import function
7171 ctx := context .Background ()
72- err := runOfficialregistryImport (ctx , testServer .URL , nil )
72+ err := runMcpregistryImport (ctx , testServer .URL , nil )
7373 if err != nil {
7474 t .Errorf ("Expected no error, got: %v" , err )
7575 }
7676}
7777
78- func TestOfficialregistryImportCommand_InvalidURL (t * testing.T ) {
78+ func TestMcpregistryImportCommand_InvalidURL (t * testing.T ) {
7979 ctx := context .Background ()
8080
8181 // Test invalid URL
82- err := runOfficialregistryImport (ctx , "not-a-url" , nil )
82+ err := runMcpregistryImport (ctx , "not-a-url" , nil )
8383 if err == nil {
8484 t .Error ("Expected error for invalid URL, got none" )
8585 }
8686
8787 // Test unsupported scheme
88- err = runOfficialregistryImport (ctx , "ftp://example.com" , nil )
88+ err = runMcpregistryImport (ctx , "ftp://example.com" , nil )
8989 if err == nil {
9090 t .Error ("Expected error for unsupported scheme, got none" )
9191 }
9292}
9393
94- func TestOfficialregistryImportCommand_HTTPError (t * testing.T ) {
94+ func TestMcpregistryImportCommand_HTTPError (t * testing.T ) {
9595 // Test server that returns 404
9696 testServer := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
9797 w .WriteHeader (http .StatusNotFound )
9898 }))
9999 defer testServer .Close ()
100100
101101 ctx := context .Background ()
102- err := runOfficialregistryImport (ctx , testServer .URL , nil )
102+ err := runMcpregistryImport (ctx , testServer .URL , nil )
103103 if err == nil {
104104 t .Error ("Expected error for 404 response, got none" )
105105 }
106106}
107107
108- func TestOfficialregistryImportCommand_InvalidJSON (t * testing.T ) {
108+ func TestMcpregistryImportCommand_InvalidJSON (t * testing.T ) {
109109 // Test server that returns invalid JSON
110110 testServer := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
111111 w .Header ().Set ("Content-Type" , "application/json" )
@@ -118,7 +118,7 @@ func TestOfficialregistryImportCommand_InvalidJSON(t *testing.T) {
118118 defer testServer .Close ()
119119
120120 ctx := context .Background ()
121- err := runOfficialregistryImport (ctx , testServer .URL , nil )
121+ err := runMcpregistryImport (ctx , testServer .URL , nil )
122122 if err == nil {
123123 t .Error ("Expected error for invalid JSON, got none" )
124124 }
0 commit comments