Files
wehub-resource-sync ead81af521
Deploy to GitHub Pages / deploy (push) Failing after 0s
CI / go (push) Has been cancelled
CI / build (darwin, macos-14) (push) Has been cancelled
CI / build (windows, windows-2025) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:31:13 +08:00

29 lines
796 B
Go

package qobuz
import "testing"
func TestBundlePrivateKeyScraped(t *testing.T) {
b := &bundle{content: `foo privateKey: "scrapedKey123" bar`}
if got := b.privateKey(); got != "scrapedKey123" {
t.Fatalf("privateKey() = %q, want scraped value", got)
}
}
func TestBundlePrivateKeyFallback(t *testing.T) {
b := &bundle{content: `no key here at all`}
if got := b.privateKey(); got != fallbackPrivateKey {
t.Fatalf("privateKey() = %q, want fallback %q", got, fallbackPrivateKey)
}
}
func TestBundleAppID(t *testing.T) {
b := &bundle{content: `x=production:{api:{appId:"798273057",appSecret:"05a4851e74ee47fda346f50cfdfc4f09"}}`}
got, err := b.appID()
if err != nil {
t.Fatalf("appID() error = %v", err)
}
if got != "798273057" {
t.Fatalf("appID() = %q, want 798273057", got)
}
}