-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmetadata_test.go
More file actions
43 lines (38 loc) · 892 Bytes
/
metadata_test.go
File metadata and controls
43 lines (38 loc) · 892 Bytes
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
35
36
37
38
39
40
41
42
43
package coconut
import (
"github.com/stretchr/testify/assert"
"os"
"testing"
)
func TestRetrieveMetadata(t *testing.T) {
cli := NewClient(Client{
APIKey: os.Getenv("COCONUT_API_KEY"),
Storage: Storage{
"service": "s3",
"region": os.Getenv("AWS_REGION"),
"credentials": StorageCredentials{
"access_key_id": os.Getenv("AWS_ACCESS_KEY_ID"),
"secret_access_key": os.Getenv("AWS_SECRET_ACCESS_KEY"),
},
"bucket": os.Getenv("AWS_BUCKET"),
"path": "/coconutgo/tests/",
},
Notification: Notification{
"type": "http",
"url": os.Getenv("COCONUT_WEBHOOK_URL"),
},
})
j, _ := cli.Job.Create(JobCreate{
Input: InputCreate{
"url": INPUT_URL,
},
Outputs: OutputCreate{
"mp4:240p": OutputParams{
"path": "/video.mp4",
},
},
})
m := cli.Metadata.Retrieve(j.Id)
assert.Equal(t, j.Id, m.JobId)
assert.NotNil(t, m.Metadata)
}