mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Wrap response error for container logs method.
Signed-off-by: Emil Davtyan <emil2k@gmail.com>
This commit is contained in:
@@ -18,6 +18,16 @@ import (
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
func TestContainerLogsNotFoundError(t *testing.T) {
|
||||
client := &Client{
|
||||
client: newMockClient(errorMock(http.StatusNotFound, "Not found")),
|
||||
}
|
||||
_, err := client.ContainerLogs(context.Background(), "container_id", types.ContainerLogsOptions{})
|
||||
if !IsErrNotFound(err) {
|
||||
t.Fatalf("expected a not found error, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerLogsError(t *testing.T) {
|
||||
client := &Client{
|
||||
client: newMockClient(errorMock(http.StatusInternalServerError, "Server error")),
|
||||
|
||||
Reference in New Issue
Block a user