MCPcopy Create free account
hub / github.com/Scalingo/cli / TestStoreAuth

Function TestStoreAuth

config/auth_test.go:14–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestStoreAuth(t *testing.T) {
15 ctx := t.Context()
16 u := &scalingo.User{
17 Email: "test@example.com",
18 Username: "test",
19 }
20 authenticator := &CliAuthenticator{}
21
22 // First creation
23 err := authenticator.StoreAuth(ctx, u, "0123456789")
24 require.NoError(t, err)
25 clean()
26
27 // Rewrite over an existing file
28 err = authenticator.StoreAuth(ctx, u, "0123456789")
29 require.NoError(t, err)
30 err = authenticator.StoreAuth(ctx, u, "0123456789")
31 require.NoError(t, err)
32 clean()
33
34 // Add an additional auth url
35 err = authenticator.StoreAuth(ctx, u, "0123456789")
36 require.NoError(t, err)
37 C.ScalingoAuthURL = "api.scalingo2.dev"
38 err = authenticator.StoreAuth(ctx, u, "0123456789")
39 require.NoError(t, err)
40 clean()
41}
42
43func TestExistingAuth(t *testing.T) {
44 ctx := t.Context()

Callers

nothing calls this directly

Calls 2

StoreAuthMethod · 0.95
cleanFunction · 0.85

Tested by

no test coverage detected