Reduce complexity in cli/command/container
Add tests for exec and cleanup existing tests.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e7f90b6b38
Component: cli
This commit is contained in:
@@ -576,7 +576,6 @@ func transformServiceVolumeConfig(data interface{}) (interface{}, error) {
|
||||
default:
|
||||
return data, errors.Errorf("invalid type %T for service volume", value)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func transformServiceNetworkMap(value interface{}) (interface{}, error) {
|
||||
|
||||
@@ -200,3 +200,13 @@ func TestParseVolumeSplitCases(t *testing.T) {
|
||||
assert.Equal(t, expected, parsed.Source != "", msg)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseVolumeInvalidEmptySpec(t *testing.T) {
|
||||
_, err := ParseVolume("")
|
||||
testutil.ErrorContains(t, err, "invalid empty volume spec")
|
||||
}
|
||||
|
||||
func TestParseVolumeInvalidSections(t *testing.T) {
|
||||
_, err := ParseVolume("/foo::rw")
|
||||
testutil.ErrorContains(t, err, "invalid spec")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user