diff options
| author | mo khan <mo@mokhan.ca> | 2025-05-12 17:33:14 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-05-12 17:33:14 -0600 |
| commit | b83870b98562a1eb9d4377dffc2283706ad574f3 (patch) | |
| tree | 15c5285c39f3880e2e68f3621a6ba9bfb22694df /test/integration/http.go | |
| parent | 32e212fb891d522efa4990bc525a51326bd7e4ba (diff) | |
test: split integration test into separate files
Diffstat (limited to 'test/integration/http.go')
| -rw-r--r-- | test/integration/http.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/integration/http.go b/test/integration/http.go new file mode 100644 index 0000000..8aeeb77 --- /dev/null +++ b/test/integration/http.go @@ -0,0 +1,24 @@ +package test + +import ( + "context" + "net/http" + "testing" + "time" + + "github.com/stretchr/testify/require" +) + +var client *http.Client = &http.Client{ + Timeout: 5 * time.Second, +} + +func HttpGet(t *testing.T, ctx context.Context, path string) *http.Response { + request, err := http.NewRequestWithContext(ctx, http.MethodGet, path, nil) + require.NoError(t, err) + + response, err := client.Do(request) + require.NoError(t, err) + + return response +} |
