This repository has been archived on 2023-04-13. You can view files and clone it, but cannot push or open issues or pull requests.
go-discogs/discogs_test.go

32 lines
531 B
Go
Raw Normal View History

2016-03-10 14:25:55 +00:00
package discogs
import (
"testing"
)
2017-02-14 19:01:50 +00:00
const (
testUserAgent = "UnitTestClient/0.0.2 +https://github.com/irlndts/go-discogs"
testToken = ""
)
2018-03-12 16:30:58 +00:00
func initDiscogsClient(t *testing.T, options *Options) *Client {
if options == nil {
options = &Options{
UserAgent: testUserAgent,
Currency: "USD",
2018-03-12 16:31:50 +00:00
Token: testToken,
2018-03-12 16:30:58 +00:00
}
}
if options.UserAgent == "" {
options.UserAgent = testUserAgent
}
client, err := NewClient(options)
if err != nil {
t.Fatalf("failed to create client: %s", err)
}
return client
}