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