MCPcopy Create free account
hub / github.com/dnote/dnote / updateConfigAPIEndpoint

Function updateConfigAPIEndpoint

pkg/e2e/sync/testutils.go:124–131  ·  view source on GitHub ↗

updateConfigAPIEndpoint updates the config file with the given API endpoint

(t *testing.T, tmpDir string, apiEndpoint string)

Source from the content-addressed store, hash-verified

122
123// updateConfigAPIEndpoint updates the config file with the given API endpoint
124func updateConfigAPIEndpoint(t *testing.T, tmpDir string, apiEndpoint string) {
125 dnoteDir := filepath.Join(tmpDir, consts.DnoteDirName)
126 configPath := filepath.Join(dnoteDir, consts.ConfigFilename)
127 configContent := fmt.Sprintf("apiEndpoint: %s\n", apiEndpoint)
128 if err := os.WriteFile(configPath, []byte(configContent), 0644); err != nil {
129 t.Fatal(errors.Wrap(err, "writing config file"))
130 }
131}
132
133// switchToEmptyServer closes the current server and creates a new empty server,
134// updating the config file to point to it.

Callers 3

TestSync_EmptyServerFunction · 0.85
setupTestEnvFunction · 0.85
switchToEmptyServerFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestSync_EmptyServerFunction · 0.68