diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2026-06-02 13:13:08 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2026-06-02 13:13:08 -0400 |
| commit | 80ca94381b48d5766c5bcf7897a804d6e2443a69 (patch) | |
| tree | 1210780353af2f3c10427f5ce36f3dc3abf3edb2 /lulu_test.go | |
| parent | 06ba9b3e492ca47f6f966bd7bd6044809b989c30 (diff) | |
| download | lulu-80ca94381b48d5766c5bcf7897a804d6e2443a69.zip | |
Diffstat (limited to 'lulu_test.go')
| -rw-r--r-- | lulu_test.go | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/lulu_test.go b/lulu_test.go index 420033c..063d5aa 100644 --- a/lulu_test.go +++ b/lulu_test.go @@ -2,10 +2,9 @@ package lulu import ( "context" + _ "embed" "encoding/json" "flag" - "fmt" - "os" "strings" "testing" "time" @@ -14,9 +13,6 @@ import ( ) const ( - clientKeyPath = "testdata/clientkey" - clientSecretPath = "testdata/clientsecret" - interiorUrl = "https://www.dropbox.com/sh/p3zh22vzsaegiri/AACOUn3LFKsITDzylh13bQpsa/161025/thesis2.pdf?dl=1" coverUrl = "https://www.dropbox.com/sh/p3zh22vzsaegiri/AADP367j0bTWlt8fCu-_tm2ia/161025/139056_cover.pdf?dl=1" @@ -24,35 +20,26 @@ const ( ) var ( - clientKey string + //go:embed testdata/clientkey + clientKey string + //go:embed testdata/clientsecret clientSecret string ) func TestMain(m *testing.M) { flag.BoolVar(&Debug, "d", false, "Print debug info to stderr.") flag.Parse() - Sandbox() - - if b, err := os.ReadFile(clientKeyPath); err == nil { - clientKey = strings.TrimSpace(string(b)) - } else { - fmt.Fprintf(os.Stderr, "%v\nCopy and paste your \"client key\" from the API Keys page into %s\n%s\n", err, clientKeyPath, SandboxApiKeyPage) - os.Exit(1) - } - if b, err := os.ReadFile(clientSecretPath); err == nil { - clientSecret = strings.TrimSpace(string(b)) - } else { - fmt.Fprintf(os.Stderr, "%v\nCopy and paste your \"client secret\" from the API Keys page into %s\n%s\n", err, clientSecretPath, SandboxApiKeyPage) - os.Exit(1) - } - m.Run() } func newClient(t *testing.T) *Client { t.Helper() - c, err := NewClient(t.Context(), clientKey, clientSecret) + creds := Credentials{ + Key: strings.TrimSpace(clientKey), + Secret: strings.TrimSpace(clientSecret), + } + c, err := NewClient(t.Context(), creds) require.NoError(t, err) return c } |