1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-24 14:31:44 +01:00

Revert "chore: updates tests"

This reverts commit 19a83b7b62.
This commit is contained in:
Amir Raminfar
2024-02-02 16:48:58 -08:00
parent 19a83b7b62
commit 1d4c162fba

View File

@@ -2,6 +2,7 @@ package web
import (
"context"
"time"
"net/http"
"net/http/httptest"
@@ -22,7 +23,7 @@ func Test_handler_streamEvents_happy(t *testing.T) {
mockedClient := new(MockedClient)
errChannel := make(chan error)
mockedClient.On("ListContainers").Return([]docker.Container{}, nil).Twice()
mockedClient.On("ListContainers").Return([]docker.Container{}, nil)
mockedClient.On("Events", mock.Anything, mock.AnythingOfType("chan<- docker.ContainerEvent")).Return(errChannel).Run(func(args mock.Arguments) {
messages := args.Get(1).(chan<- docker.ContainerEvent)
go func() {
@@ -36,6 +37,7 @@ func Test_handler_streamEvents_happy(t *testing.T) {
ActorID: "1234",
Host: "localhost",
}
time.Sleep(100 * time.Millisecond)
cancel()
}()
})
@@ -44,7 +46,7 @@ func Test_handler_streamEvents_happy(t *testing.T) {
Name: "test",
Image: "test",
Stats: utils.NewRingBuffer[docker.ContainerStat](300), // 300 seconds of stats
}, nil).Once()
}, nil)
clients := map[string]docker.Client{
"localhost": mockedClient,