mirror of https://github.com/docker/cli.git
Minor touch-ups in network-option tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
c4844b1fdd
commit
a88d17c2a4
|
@ -28,7 +28,7 @@ func TestNetworkOptLegacySyntax(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNetworkOptCompleteSyntax(t *testing.T) {
|
func TestNetworkOptAdvancedSyntax(t *testing.T) {
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
value string
|
value string
|
||||||
expected []NetworkAttachmentOpts
|
expected []NetworkAttachmentOpts
|
||||||
|
@ -69,13 +69,15 @@ func TestNetworkOptCompleteSyntax(t *testing.T) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
var network NetworkOpt
|
t.Run(tc.value, func(t *testing.T) {
|
||||||
assert.NilError(t, network.Set(tc.value))
|
var network NetworkOpt
|
||||||
assert.Check(t, is.DeepEqual(tc.expected, network.Value()))
|
assert.NilError(t, network.Set(tc.value))
|
||||||
|
assert.Check(t, is.DeepEqual(tc.expected, network.Value()))
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNetworkOptInvalidSyntax(t *testing.T) {
|
func TestNetworkOptAdvancedSyntaxInvalid(t *testing.T) {
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
value string
|
value string
|
||||||
expectedError string
|
expectedError string
|
||||||
|
@ -94,7 +96,9 @@ func TestNetworkOptInvalidSyntax(t *testing.T) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
var network NetworkOpt
|
t.Run(tc.value, func(t *testing.T) {
|
||||||
assert.ErrorContains(t, network.Set(tc.value), tc.expectedError)
|
var network NetworkOpt
|
||||||
|
assert.ErrorContains(t, network.Set(tc.value), tc.expectedError)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue