package steme import ( "testing" ) // Note: context is used in the skipped integration test // TestClientIntegration is a placeholder for integration tests. // // This would test against a real StemeDB server. For now, it's skipped // unless the STEMEDB_URL environment variable is set. func TestClientIntegration(t *testing.T) { t.Skip("Integration test requires running StemeDB server") // Example integration test structure: /* baseURL := os.Getenv("STEMEDB_URL") if baseURL == "" { t.Skip("STEMEDB_URL not set") } signer, err := GenerateSigner() if err != nil { t.Fatalf("GenerateSigner() failed: %v", err) } client := NewClient(baseURL, signer) // Test health check health, err := client.Health(context.Background()) if err != nil { t.Fatalf("Health() failed: %v", err) } if health.Status != "healthy" { t.Errorf("Health.Status = %s, want healthy", health.Status) } // Test assertion creation assertion := NewAssertion("test_entity", "test_predicate"). WithText("test value"). WithConfidence(0.95). WithSourceHash("0000000000000000000000000000000000000000000000000000000000000000"). Build() hash, err := client.Assert(context.Background(), assertion) if err != nil { t.Fatalf("Assert() failed: %v", err) } if len(hash) != 64 { t.Errorf("Assert() hash length = %d, want 64", len(hash)) } // Test query params := NewQuery(). WithSubject("test_entity"). WithPredicate("test_predicate"). Build() result, err := client.Query(context.Background(), params) if err != nil { t.Fatalf("Query() failed: %v", err) } if result.TotalCount == 0 { t.Errorf("Query() returned no results") } */ }