本文整理汇总了Golang中github.com/juju/juju/testing.Attrs.Delete方法的典型用法代码示例。如果您正苦于以下问题:Golang Attrs.Delete方法的具体用法?Golang Attrs.Delete怎么用?Golang Attrs.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/juju/juju/testing.Attrs
的用法示例。
在下文中一共展示了Attrs.Delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
about: "set-numa-control-policy off",
useDefaults: config.UseDefaults,
attrs: minimalConfigAttrs.Merge(testing.Attrs{
"set-numa-control-policy": false,
}),
}, {
about: "Invalid agent version",
useDefaults: config.UseDefaults,
attrs: minimalConfigAttrs.Merge(testing.Attrs{
"agent-version": "2",
}),
err: `invalid agent version in model configuration: "2"`,
}, {
about: "Missing type",
useDefaults: config.UseDefaults,
attrs: minimalConfigAttrs.Delete("type"),
err: "type: expected string, got nothing",
}, {
about: "Empty type",
useDefaults: config.UseDefaults,
attrs: minimalConfigAttrs.Merge(testing.Attrs{
"type": "",
}),
err: "empty type in model configuration",
}, {
about: "Missing name",
useDefaults: config.UseDefaults,
attrs: minimalConfigAttrs.Delete("name"),
err: "name: expected string, got nothing",
}, {
about: "Bad name, no slash",
示例2:
attrs: sampleConfig.Merge(testing.Attrs{"ca-cert-path": "arble"}),
err: `attribute "ca-cert-path" is not allowed in configuration`,
}, {
about: "No defaults: with ca-private-key-path",
useDefaults: config.NoDefaults,
attrs: sampleConfig.Merge(testing.Attrs{"ca-private-key-path": "arble"}),
err: `attribute "ca-private-key-path" is not allowed in configuration`,
}, {
about: "No defaults: with authorized-keys-path",
useDefaults: config.NoDefaults,
attrs: sampleConfig.Merge(testing.Attrs{"authorized-keys-path": "arble"}),
err: `attribute "authorized-keys-path" is not allowed in configuration`,
}, {
about: "No defaults: missing authorized-keys",
useDefaults: config.NoDefaults,
attrs: sampleConfig.Delete("authorized-keys"),
err: `authorized-keys missing from environment configuration`,
}, {
about: "Config settings from juju 1.13.3 actual installation",
useDefaults: config.NoDefaults,
attrs: map[string]interface{}{
"name": "sample",
"development": false,
"admin-secret": "",
"ssl-hostname-verification": true,
"authorized-keys": "ssh-rsa mykeys [email protected]\n",
"control-bucket": "rog-some-control-bucket",
"region": "us-east-1",
"image-metadata-url": "",
"ca-private-key": "",
"default-series": "precise",
示例3:
}, {
summary: "changing region",
config: requiredConfig,
change: testing.Attrs{
"region": "otherregion",
},
err: `cannot change region from "configtest" to "otherregion"`,
}, {
summary: "invalid region",
config: requiredConfig.Merge(testing.Attrs{
"region": 666,
}),
err: `.*expected string, got int\(666\)`,
}, {
summary: "missing region in model",
config: requiredConfig.Delete("region"),
err: "missing region not valid",
}, {
summary: "invalid username",
config: requiredConfig.Merge(testing.Attrs{
"username": 666,
}),
err: `.*expected string, got int\(666\)`,
}, {
summary: "missing username in model",
config: requiredConfig.Delete("username"),
err: "missing username not valid",
}, {
summary: "invalid password",
config: requiredConfig.Merge(testing.Attrs{
"password": 666,