(t *testing.T)
| 13 | ) |
| 14 | |
| 15 | func TestCLIAPI(t *testing.T) { |
| 16 | ctx, env := repotesting.NewEnvironment(t, repotesting.FormatNotImportant) |
| 17 | srvInfo := servertesting.StartServer(t, env, false) |
| 18 | |
| 19 | cli, err := apiclient.NewKopiaAPIClient(apiclient.Options{ |
| 20 | BaseURL: srvInfo.BaseURL, |
| 21 | TrustedServerCertificateFingerprint: srvInfo.TrustedServerCertificateFingerprint, |
| 22 | Username: servertesting.TestUIUsername, |
| 23 | Password: servertesting.TestUIPassword, |
| 24 | }) |
| 25 | |
| 26 | require.NoError(t, err) |
| 27 | require.NoError(t, cli.FetchCSRFTokenForTesting(ctx)) |
| 28 | |
| 29 | resp := &serverapi.CLIInfo{} |
| 30 | require.NoError(t, cli.Get(ctx, "cli", nil, resp)) |
| 31 | |
| 32 | exe, _ := os.Executable() |
| 33 | |
| 34 | require.Equal(t, exe+" --config-file="+env.ConfigFile(), resp.Executable) |
| 35 | } |
nothing calls this directly
no test coverage detected