Documentation
¶
Index ¶
- func CleanupServerHub(t *testing.T, deps *core.ServerDependencies)
- func CreateTestDeps(t *testing.T, cfg *config.Config, configFile string) *core.ServerDependencies
- func CurrentHub() *ws.Hub
- func InitTestWebSocket(t *testing.T)
- func NewMockActressRepo() *database.ActressRepository
- func NewMockMovieRepo() *database.MovieRepository
- func StartStandaloneHub() (*ws.Hub, context.CancelFunc, <-chan struct{})
- type MockScraperWithResults
- func (m *MockScraperWithResults) Close() error
- func (m *MockScraperWithResults) Config() *config.ScraperSettings
- func (m *MockScraperWithResults) GetURL(id string) (string, error)
- func (m *MockScraperWithResults) IsEnabled() bool
- func (m *MockScraperWithResults) Name() string
- func (m *MockScraperWithResults) Search(id string) (*models.ScraperResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupServerHub ¶
func CleanupServerHub(t *testing.T, deps *core.ServerDependencies)
CleanupServerHub gracefully shuts down websocket runtime for dependencies.
func CreateTestDeps ¶
CreateTestDeps creates minimal ServerDependencies for testing.
func CurrentHub ¶
CurrentHub returns the default websocket hub for assertions.
func InitTestWebSocket ¶
InitTestWebSocket initializes runtime websocket state for tests.
func NewMockActressRepo ¶
func NewMockActressRepo() *database.ActressRepository
NewMockActressRepo creates a test actress repository with in-memory database.
func NewMockMovieRepo ¶
func NewMockMovieRepo() *database.MovieRepository
NewMockMovieRepo creates a test movie repository with in-memory database.
func StartStandaloneHub ¶
func StartStandaloneHub() (*ws.Hub, context.CancelFunc, <-chan struct{})
StartStandaloneHub starts a websocket hub with cancellation for dedicated tests.
Types ¶
type MockScraperWithResults ¶
type MockScraperWithResults struct {
// contains filtered or unexported fields
}
mockScraperWithResults implements Scraper and returns predefined results For security testing, it echoes back the ID in the result to verify sanitization
func NewMockScraperWithResults ¶
func NewMockScraperWithResults(name string, enabled bool, result *models.ScraperResult, err error) *MockScraperWithResults
NewMockScraperWithResults creates a new mock scraper with predefined results
func (*MockScraperWithResults) Close ¶
func (m *MockScraperWithResults) Close() error
func (*MockScraperWithResults) Config ¶
func (m *MockScraperWithResults) Config() *config.ScraperSettings
func (*MockScraperWithResults) GetURL ¶
func (m *MockScraperWithResults) GetURL(id string) (string, error)
func (*MockScraperWithResults) IsEnabled ¶
func (m *MockScraperWithResults) IsEnabled() bool
func (*MockScraperWithResults) Name ¶
func (m *MockScraperWithResults) Name() string
func (*MockScraperWithResults) Search ¶
func (m *MockScraperWithResults) Search(id string) (*models.ScraperResult, error)