MCPcopy
hub / github.com/ory/hydra / writeTempFile

Function writeTempFile

cmd/cmd_import_client_test.go:23–31  ·  view source on GitHub ↗
(t *testing.T, contents interface{})

Source from the content-addressed store, hash-verified

21)
22
23func writeTempFile(t *testing.T, contents interface{}) string {
24 t.Helper()
25 fn := filepath.Join(t.TempDir(), "content.json")
26 f, err := os.Create(fn)
27 require.NoError(t, err)
28 require.NoError(t, json.NewEncoder(f).Encode(contents))
29 require.NoError(t, f.Close())
30 return fn
31}
32
33func TestImportClient(t *testing.T) {
34 t.Context()

Callers 2

TestUpdateClientFunction · 0.85
TestImportClientFunction · 0.85

Calls 2

CloseMethod · 0.65
EncodeMethod · 0.45

Tested by

no test coverage detected