Skip to content

Commit 88397a1

Browse files
feat(cmd): test SSH_KEY mangling in ConfigSet
This test ensures that parseSSHKey is called from ConfigSet.
1 parent 403d4b9 commit 88397a1

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

cmd/config_test.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ func TestConfigSet(t *testing.T) {
154154
if r.Method == "POST" {
155155
testutil.AssertBody(t, api.Config{
156156
Values: map[string]interface{}{
157-
"TRUE": "false",
157+
"TRUE": "false",
158+
"SSH_KEY": "LS0tLS1CRUdJTiBPUEVOU1NIIFBSSVZBVEUgS0VZLS0tLS0=",
158159
},
159160
}, r)
160161
}
@@ -166,6 +167,7 @@ func TestConfigSet(t *testing.T) {
166167
"TEST": "testing",
167168
"NCC": "1701",
168169
"TRUE": "false",
170+
"SSH_KEY": "LS0tLS1CRUdJTiBPUEVOU1NIIFBSSVZBVEUgS0VZLS0tLS0=",
169171
"FLOAT": "12.34"
170172
},
171173
"memory": {},
@@ -181,16 +183,17 @@ func TestConfigSet(t *testing.T) {
181183
var b bytes.Buffer
182184
cmdr := DeisCmd{WOut: &b, ConfigFile: cf}
183185

184-
err = cmdr.ConfigSet("foo", []string{"TRUE=false"})
186+
err = cmdr.ConfigSet("foo", []string{"TRUE=false", "SSH_KEY=-----BEGIN OPENSSH PRIVATE KEY-----"})
185187
assert.NoErr(t, err)
186188

187189
assert.Equal(t, testutil.StripProgress(b.String()), `Creating config... done
188190
189191
=== foo Config
190-
FLOAT 12.34
191-
NCC 1701
192-
TEST testing
193-
TRUE false
192+
FLOAT 12.34
193+
NCC 1701
194+
SSH_KEY LS0tLS1CRUdJTiBPUEVOU1NIIFBSSVZBVEUgS0VZLS0tLS0=
195+
TEST testing
196+
TRUE false
194197
`, "output")
195198
}
196199

0 commit comments

Comments
 (0)