MCPcopy Create free account
hub / github.com/bluekeyes/patch2pr / TestGraphQLApplier

Function TestGraphQLApplier

graphql_applier_test.go:20–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

18}
19
20func TestGraphQLApplier(t *testing.T) {
21 tctx := prepareTestContext(t)
22
23 t.Logf("Test ID: %s", tctx.ID)
24 t.Logf("Test Repository: %s", tctx.Repo.String())
25
26 createBranch(t, tctx)
27 defer cleanupBranches(t, tctx)
28
29 patches, err := filepath.Glob(filepath.Join("testdata", "patches", "*.patch"))
30 if err != nil {
31 t.Fatalf("error listing patches: %v", err)
32 }
33
34 t.Logf("Discovered %d patches", len(patches))
35 for _, patch := range patches {
36 name := strings.TrimSuffix(filepath.Base(patch), ".patch")
37 t.Run(name, func(t *testing.T) {
38 runGraphQLPatchTest(t, tctx, name)
39 })
40 }
41}
42
43func runGraphQLPatchTest(t *testing.T, tctx *TestContext, name string) {
44 f, err := os.Open(filepath.Join("testdata", "patches", name+".patch"))

Callers

nothing calls this directly

Calls 5

prepareTestContextFunction · 0.85
createBranchFunction · 0.85
cleanupBranchesFunction · 0.85
runGraphQLPatchTestFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected