client/instances test files

This commit is contained in:
2024-12-13 16:55:46 -06:00
parent 4d98678275
commit ca1ab2f16b
2 changed files with 59 additions and 0 deletions

23
api/instances_test.go Normal file
View File

@@ -0,0 +1,23 @@
//go:build real
package api
import (
"testing"
)
func GetInstancesTest(t *testing.T) {
// Create a new client with the test server's URL
client := NewClient("test")
// Call the GetInstances method
resp, err := client.GetInstances()
if err != nil {
t.Fatal(err)
}
// Ensure the response is valid
if len(resp.Instances) != 0 {
t.Fatalf("expected 0 instances, got %d", len(resp.Instances))
}
}