MCPcopy Index your code
hub / github.com/kopia/kopia / Close

Method Close

internal/repotesting/repotesting.go:141–155  ·  view source on GitHub ↗

Close closes testing environment.

(ctx context.Context, tb testing.TB)

Source from the content-addressed store, hash-verified

139
140// Close closes testing environment.
141func (e *Environment) Close(ctx context.Context, tb testing.TB) {
142 tb.Helper()
143
144 err := e.RepositoryWriter.Close(ctx)
145 require.NoError(tb, err, "unable to close")
146
147 if e.connected {
148 err := repo.Disconnect(ctx, e.ConfigFile())
149 require.NoError(tb, err, "error disconnecting")
150 }
151
152 err = os.Remove(e.configDir)
153 // should be empty, assuming Disconnect was successful
154 require.NoError(tb, err, "error removing config directory")
155}
156
157// ConfigFile returns the name of the config file.
158func (e *Environment) ConfigFile() string {

Callers 1

NewEnvironmentFunction · 0.95

Calls 5

ConfigFileMethod · 0.95
DisconnectFunction · 0.92
HelperMethod · 0.80
CloseMethod · 0.65
RemoveMethod · 0.65

Tested by

no test coverage detected