MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / NewTestDataProvider

Function NewTestDataProvider

testutil/test_data_provider.go:28–40  ·  view source on GitHub ↗

NewTestDataProvider creates a new TestDataProvider

(t TestDataProviderT)

Source from the content-addressed store, hash-verified

26
27// NewTestDataProvider creates a new TestDataProvider
28func NewTestDataProvider(t TestDataProviderT) *TestDataProvider {
29 t().Helper()
30
31 path, err := findProjectRoot()
32 if err != nil {
33 require.NoError(t(), err)
34 }
35
36 return &TestDataProvider{
37 path: filepath.Join(path, TestDataFolderName),
38 t: t,
39 }
40}
41
42// findProjectRoot finds the absolute path to the project root by looking for go.mod
43func findProjectRoot() (string, error) {

Callers 7

SetupSuiteMethod · 0.92
SetupSuiteMethod · 0.92
SetupSuiteMethod · 0.92
TestParseExistingFileFunction · 0.92
SetupSuiteMethod · 0.92
SetupSuiteMethod · 0.92
SetupSuiteMethod · 0.92

Calls 1

findProjectRootFunction · 0.85

Tested by 6

SetupSuiteMethod · 0.74
SetupSuiteMethod · 0.74
TestParseExistingFileFunction · 0.74
SetupSuiteMethod · 0.74
SetupSuiteMethod · 0.74
SetupSuiteMethod · 0.74