Merge pull request #477 from dnephin/some-tests-for-container-command

A few tests for container command
Upstream-commit: 8ea02f6f08
Component: cli
This commit is contained in:
Victor Vieux
2017-08-30 09:38:38 -07:00
committed by GitHub
13 changed files with 420 additions and 186 deletions
@@ -572,7 +572,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")
}