MCPcopy Index your code
hub / github.com/coder/coder / setupFakeLicenseServerTest

Function setupFakeLicenseServerTest

enterprise/cli/licenses_test.go:228–241  ·  view source on GitHub ↗
(t *testing.T, args ...string)

Source from the content-addressed store, hash-verified

226}
227
228func setupFakeLicenseServerTest(t *testing.T, args ...string) *serpent.Invocation {
229 t.Helper()
230 s := httptest.NewServer(newFakeLicenseAPI(t))
231 t.Cleanup(s.Close)
232
233 inv, conf := newCLI(t, args...)
234
235 err := conf.URL().Write(s.URL)
236 require.NoError(t, err)
237 err = conf.Session().Write("sessiontoken")
238 require.NoError(t, err)
239
240 return inv
241}
242
243func attachPty(t *testing.T, inv *serpent.Invocation) *ptytest.PTY {
244 pty := ptytest.New(t)

Callers 3

TestLicensesAddFakeFunction · 0.85
TestLicensesListFakeFunction · 0.85
TestLicensesDeleteFakeFunction · 0.85

Calls 7

newFakeLicenseAPIFunction · 0.85
newCLIFunction · 0.85
HelperMethod · 0.65
CleanupMethod · 0.65
WriteMethod · 0.65
SessionMethod · 0.65
URLMethod · 0.45

Tested by

no test coverage detected