Documentation
¶
Index ¶
- func AssertFileContains(t *testing.T, path string, substring string)
- func AssertFileContent(t *testing.T, path string, expected []byte)
- func AssertFileExists(t *testing.T, path string)
- func AssertFileNotExists(t *testing.T, path string)
- func CaptureOutput(t *testing.T, f func()) (stdout, stderr string)
- func CompareDirectories(t *testing.T, dir1, dir2 string)
- func CreateTestDirectory(t *testing.T) string
- func CreateTestFile(t *testing.T, path string, content []byte)
- func CreateTestWordDirectory(t *testing.T, baseDir, word string) string
- type MockFileSystem
- type MockHTTPClient
- type MockOpenAIClient
- type MockResponse
- type MockTranslator
- type TestDataGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertFileContains ¶
AssertFileContains checks if a file contains a substring
func AssertFileContent ¶
AssertFileContent checks if a file has expected content
func AssertFileExists ¶
AssertFileExists checks if a file exists
func AssertFileNotExists ¶
AssertFileNotExists checks if a file does not exist
func CaptureOutput ¶
CaptureOutput captures stdout/stderr during test execution
func CompareDirectories ¶
CompareDirectories compares two directories recursively
func CreateTestDirectory ¶
CreateTestDirectory creates a temporary directory structure for testing
func CreateTestFile ¶
CreateTestFile creates a test file with content
Types ¶
type MockFileSystem ¶
MockFileSystem mocks file system operations
func (*MockFileSystem) Exists ¶
func (m *MockFileSystem) Exists(path string) bool
Exists mocks checking if a file exists
type MockHTTPClient ¶
type MockHTTPClient struct {
Responses map[string]*MockResponse
Errors map[string]error
Calls []string
}
MockHTTPClient mocks HTTP client for testing
func (*MockHTTPClient) Get ¶
func (m *MockHTTPClient) Get(url string) (*MockResponse, error)
Get mocks an HTTP GET request
func (*MockHTTPClient) Post ¶
func (m *MockHTTPClient) Post(url string, body interface{}) (*MockResponse, error)
Post mocks an HTTP POST request
type MockOpenAIClient ¶
type MockOpenAIClient struct {
TTSResponses map[string][]byte
ImageResponses map[string]string
Errors map[string]error
Calls []string
}
MockOpenAIClient mocks OpenAI API client
func (*MockOpenAIClient) CreateImage ¶
CreateImage mocks OpenAI DALL-E API
func (*MockOpenAIClient) CreateSpeech ¶
func (m *MockOpenAIClient) CreateSpeech(ctx context.Context, text, voice, model string) (io.ReadCloser, error)
CreateSpeech mocks OpenAI TTS API
type MockResponse ¶
MockResponse represents a mocked HTTP response
type MockTranslator ¶
type MockTranslator struct {
Translations map[string]string
Errors map[string]error
Calls []string
}
MockTranslator mocks translation service
type TestDataGenerator ¶
type TestDataGenerator struct{}
TestDataGenerator generates test data
func (*TestDataGenerator) GenerateAudioData ¶
func (g *TestDataGenerator) GenerateAudioData() []byte
GenerateAudioData generates mock audio data
func (*TestDataGenerator) GenerateBulgarianWord ¶
func (g *TestDataGenerator) GenerateBulgarianWord() string
GenerateBulgarianWord generates a test Bulgarian word
func (*TestDataGenerator) GenerateImageData ¶
func (g *TestDataGenerator) GenerateImageData() []byte
GenerateImageData generates mock image data