Files
zeekay e08e78cc3d feat: add ZAP transport, Hanzo IAM auth, and billing enforcement
Add three new packages for ZT SDK integration:
- zap/: ZAP transport adapter with 4-byte length-prefix framing over ZT connections
- auth/hanzo/: Hanzo IAM JWT credential resolution (env + auth file)
- billing/: Commerce API billing guard with balance check and usage recording (no free tier)
2026-02-19 14:26:22 -08:00

27 lines
556 B
Go

package billing
import (
"testing"
)
func TestInsufficientBalanceError(t *testing.T) {
err := &InsufficientBalanceError{
Service: "test-svc",
Balance: -5.0,
}
msg := err.Error()
if msg == "" {
t.Error("expected non-empty error message")
}
if err.Service != "test-svc" {
t.Errorf("expected service 'test-svc', got '%s'", err.Service)
}
}
func TestDefaultGuard(t *testing.T) {
g := DefaultGuard("test-token")
if g.commerceURL != "https://api.hanzo.ai/commerce" {
t.Errorf("expected default commerce URL, got '%s'", g.commerceURL)
}
}