Skip to content

Commit dc8e60f

Browse files
committed
civo test cases added
1 parent 8cc8baf commit dc8e60f

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

plugins/civo/api_key.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,6 @@ func TryCivoConfigFile() sdk.Importer {
8989
})
9090
}
9191

92-
// {
93-
// "apikeys": {
94-
// "newspidey": "Vdi1GHFqXLG47VcfdvfvfvfvfvfvfvfvEgOd",
95-
// },
96-
// "meta": {
97-
// "admin": false,
98-
// "current_apikey": "newspidey",
99-
// "default_region": "LON1",
100-
// "latest_release_check": "2023-06-11T20:25:06.916682112+05:30",
101-
// "url": "https://api.civo.com",
102-
// "last_command_executed": "2023-06-11T20:25:06.916237569+05:30"
103-
// }
104-
// }
105-
10692
type Config struct {
10793
Properties map[string]json.RawMessage `json:"apikeys"`
10894

plugins/civo/api_key_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ import (
1111
func TestAPIKeyProvisioner(t *testing.T) {
1212
plugintest.TestProvisioner(t, APIKey().DefaultProvisioner, map[string]plugintest.ProvisionCase{
1313
"default": {
14-
ItemFields: map[sdk.FieldName]string{ // TODO: Check if this is correct
15-
fieldname.APIKey: "XFIx85McyfCQc490j1tBa5b5s2XiWerNdOdfnkrOnchEXAMPLE",
14+
ItemFields: map[sdk.FieldName]string{
15+
fieldname.APIKey: "XFIx85McyfCQc490j1tBa5b5s2XiWerNdOdfnkrOnchEXAMPLE",
16+
fieldname.APIKeyID: "testdemoname",
1617
},
1718
ExpectedOutput: sdk.ProvisionOutput{
1819
Environment: map[string]string{
19-
"CIVO_API_KEY": "XFIx85McyfCQc490j1tBa5b5s2XiWerNdOdfnkrOnchEXAMPLE",
20+
"CIVO_API_KEY": "XFIx85McyfCQc490j1tBa5b5s2XiWerNdOdfnkrOnchEXAMPLE",
21+
"CIVO_API_KEY_NAME": "testdemoname",
2022
},
2123
},
2224
},

0 commit comments

Comments
 (0)