-
Notifications
You must be signed in to change notification settings - Fork 3
/
uploader_test.go
34 lines (24 loc) · 825 Bytes
/
uploader_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// +build integration
package bodycomposition
import (
"os"
"testing"
)
const garminEmailEnvKey = "GARMIN_EMAIL"
const garminPasswordEnvKey = "GARMIN_PASSWORD"
// TestUploadWeightToGarminIntegration uploading a weight-in to garmin connect
func TestUploadWeightToGarminIntegration(t *testing.T) {
email := os.Getenv(garminEmailEnvKey)
passWord := os.Getenv(garminPasswordEnvKey)
if email == "" {
t.Fatalf("Environment variable %s was not set. This is required.", garminEmailEnvKey)
}
if passWord == "" {
t.Fatalf("Environment variable %s was not set. This is required.", garminPasswordEnvKey)
}
bc := NewBodyComposition(80, 14.4, 55.2, 37, 45.5, 21, 5, 23, 2250, 12.6, -1)
err := Upload(email, passWord, bc)
if err != nil {
t.Fatalf("Error uploading weight to Garmin Connect: %s", err.Error())
}
}