helpers

package
v0.0.0-...-37e4f78 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateRequest

func AuthenticateRequest(c *gin.Context)

AuthenticateRequest adds authentication headers to a request

func CreateMultipartRequest

func CreateMultipartRequest(t *testing.T, filePath string, params map[string]string) (*http.Request, error)

CreateMultipartRequest creates a multipart HTTP request with the specified file and params

func CreateTestFile

func CreateTestFile(t *testing.T, content []byte) (*os.File, error)

CreateTestFile creates a temporary file with specified content for testing

func SetupMockDependencies

func SetupMockDependencies() (*mocks.MockVideoService, *mocks.MockResponseHandler, *mocks.MockLogger, *video.App)

SetupMockDependencies creates and returns all mock dependencies for testing

func SetupMockServices

SetupMockServices returns mock services for testing

func SetupTestContext

func SetupTestContext() (*gin.Context, *httptest.ResponseRecorder)

SetupTestContext creates a Gin test context with a recorder for HTTP responses

func SetupTestGinEngine

func SetupTestGinEngine() *gin.Engine

SetupTestGinEngine returns a configured gin engine for testing

func SetupTestUploads

func SetupTestUploads(videos []video.Video) []video.VideoUpload

SetupTestUploads creates test upload objects for testing

func SetupTestVideos

func SetupTestVideos(count int) []video.Video

SetupTestVideos creates test video objects for testing

func VideoConfigForTest

func VideoConfigForTest() *video.Config

VideoConfigForTest returns a test video configuration

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL