Signed-off-by: Jamie Hannaford <jamie@limetree.org>
This commit is contained in:
Jamie Hannaford
2017-11-14 16:43:35 +01:00
parent 9c9303e113
commit 0450a2f437
3 changed files with 39 additions and 10 deletions

View File

@ -13,6 +13,12 @@ import (
"github.com/stretchr/testify/assert"
)
var logFn = func(expectedOut string) func(string, types.ContainerLogsOptions) (io.ReadCloser, error) {
return func(container string, opts types.ContainerLogsOptions) (io.ReadCloser, error) {
return ioutil.NopCloser(strings.NewReader(expectedOut)), nil
}
}
func TestRunLogs(t *testing.T) {
inspectFn := func(containerID string) (types.ContainerJSON, error) {
return types.ContainerJSON{
@ -21,12 +27,6 @@ func TestRunLogs(t *testing.T) {
}, nil
}
logFn := func(expectedOut string) func(string, types.ContainerLogsOptions) (io.ReadCloser, error) {
return func(container string, opts types.ContainerLogsOptions) (io.ReadCloser, error) {
return ioutil.NopCloser(strings.NewReader(expectedOut)), nil
}
}
var testcases = []struct {
doc string
options *logsOptions