(t *testing.T)
| 12 | ) |
| 13 | |
| 14 | func TestCreateToken(t *testing.T) { |
| 15 | u := test.CreateUser() |
| 16 | t.Cleanup(func() { |
| 17 | test.DeleteUser(u) |
| 18 | }) |
| 19 | |
| 20 | cmd := test.GetRootCmdWithSubCommands(NewCmds()...) |
| 21 | cmd.SetArgs([]string{"create-token", "-u", u, "-e", strconv.FormatInt(time.Now().Unix(), 10)}) |
| 22 | _, err := cmd.ExecuteC() |
| 23 | require.NoError(t, err) |
| 24 | require.Contains(t, cmd.OutOrStdout().(*bytes.Buffer).String(), "Token for user") |
| 25 | } |
| 26 | |
| 27 | func TestUpsertUser(t *testing.T) { |
| 28 | cmd := test.GetRootCmdWithSubCommands(NewCmds()...) |
nothing calls this directly
no test coverage detected