-
Notifications
You must be signed in to change notification settings - Fork 258
Expand file tree
/
Copy pathservice_token_test.go
More file actions
46 lines (42 loc) · 1.29 KB
/
service_token_test.go
File metadata and controls
46 lines (42 loc) · 1.29 KB
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
44
45
46
package doppler
import (
"testing"
"github.com/1Password/shell-plugins/sdk"
"github.com/1Password/shell-plugins/sdk/plugintest"
"github.com/1Password/shell-plugins/sdk/schema/fieldname"
)
func TestServiceTokenImporter(t *testing.T) {
plugintest.TestImporter(t, ServiceToken().Importer, map[string]plugintest.ImportCase{
"DOPPLER_TOKEN environment variable": {
Environment: map[string]string{
"DOPPLER_TOKEN": "dp.pt.SQgRDoLc2lBYVu5Vr2T4XHPvBcp0HlhMZq8F11whbvQEXAMPLE",
},
ExpectedCandidates: []sdk.ImportCandidate{
{
Fields: map[sdk.FieldName]string{
fieldname.Token: "dp.pt.SQgRDoLc2lBYVu5Vr2T4XHPvBcp0HlhMZq8F11whbvQEXAMPLE",
},
},
{
Fields: map[sdk.FieldName]string{
fieldname.Token: "dp.pt.SQgRDoLc2lBYVu5Vr2T4XHPvBcp0HlhMZq8F11whbvQEXAMPLE",
},
},
},
},
})
}
func TestServiceTokenProvisioner(t *testing.T) {
plugintest.TestProvisioner(t, ServiceToken().DefaultProvisioner, map[string]plugintest.ProvisionCase{
"default": {
ItemFields: map[sdk.FieldName]string{
fieldname.Token: "dp.pt.SQgRDoLc2lBYVu5Vr2T4XHPvBcp0HlhMZq8F11whbvQEXAMPLE",
},
ExpectedOutput: sdk.ProvisionOutput{
Environment: map[string]string{
"DOPPLER_TOKEN": "dp.pt.SQgRDoLc2lBYVu5Vr2T4XHPvBcp0HlhMZq8F11whbvQEXAMPLE",
},
},
},
})
}