(t *testing.T)
| 88 | } |
| 89 | |
| 90 | func TestUploadHostForTenant(t *testing.T) { |
| 91 | a := testAsset(t, "shot.png", "image/png", "x") |
| 92 | |
| 93 | reg := &httpmock.Registry{} |
| 94 | defer reg.Verify(t) |
| 95 | reg.Register( |
| 96 | httpmock.REST("POST", "user-attachments/assets"), |
| 97 | httpmock.StatusStringResponse(201, `{"url":"https://acme.ghe.com/user-attachments/assets/1"}`), |
| 98 | ) |
| 99 | |
| 100 | _, err := newTestUploader(t, reg, "acme.ghe.com", 1).upload(context.Background(), a) |
| 101 | |
| 102 | require.NoError(t, err) |
| 103 | require.Len(t, reg.Requests, 1) |
| 104 | assert.Equal(t, "uploads.acme.ghe.com", reg.Requests[0].URL.Host) |
| 105 | } |
| 106 | |
| 107 | func TestUploadAuthentication(t *testing.T) { |
| 108 | tests := []struct { |
nothing calls this directly
no test coverage detected