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:
Daniel Nephin
2017-08-29 19:25:50 -04:00
parent 7ae4b76cda
commit 811eac4392
13 changed files with 420 additions and 186 deletions
@@ -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")
}