MCPcopy Create free account
hub / github.com/coder/coder / TestLicensesAddReal

Function TestLicensesAddReal

enterprise/cli/licenses_test.go:116–133  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

114}
115
116func TestLicensesAddReal(t *testing.T) {
117 t.Parallel()
118 t.Run("Fails", func(t *testing.T) {
119 t.Parallel()
120 client, _ := coderdenttest.New(t, &coderdenttest.Options{DontAddLicense: true})
121 inv, conf := newCLI(
122 t,
123 "licenses", "add", "-l", fakeLicenseJWT,
124 )
125 clitest.SetupConfig(t, client, conf) //nolint:gocritic // requires owner
126
127 waiter := clitest.StartWithWaiter(t, inv)
128 var coderError *codersdk.Error
129 waiter.RequireAs(&coderError)
130 assert.Equal(t, 400, coderError.StatusCode())
131 assert.Contains(t, "Invalid license", coderError.Message)
132 })
133}
134
135func TestLicensesListFake(t *testing.T) {
136 t.Parallel()

Callers

nothing calls this directly

Calls 9

StatusCodeMethod · 0.95
NewFunction · 0.92
SetupConfigFunction · 0.92
StartWithWaiterFunction · 0.92
newCLIFunction · 0.85
RequireAsMethod · 0.80
RunMethod · 0.65
EqualMethod · 0.45
ContainsMethod · 0.45

Tested by

no test coverage detected