26 lines
685 B
Go
26 lines
685 B
Go
package v1
|
|
|
|
import (
|
|
"net/http/httptest"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func TestWriteReportCSV_Cov26b(t *testing.T) {
|
|
gin.SetMode(gin.TestMode)
|
|
w := httptest.NewRecorder()
|
|
c, _ := gin.CreateTestContext(w)
|
|
c.Request = httptest.NewRequest("GET", "/", nil)
|
|
writeReportCSV(c, "test_report", time.Now().AddDate(0, -1, 0), time.Now(), []string{"Col1", "Col2"}, [][]string{{"a", "b"}})
|
|
}
|
|
|
|
func TestWriteConversationTrafficCSV_Cov26b(t *testing.T) {
|
|
gin.SetMode(gin.TestMode)
|
|
w := httptest.NewRecorder()
|
|
c, _ := gin.CreateTestContext(w)
|
|
c.Request = httptest.NewRequest("GET", "/", nil)
|
|
writeConversationTrafficCSV(c, 0, [][]string{{"2024-01-01", "10", "5"}})
|
|
}
|