MCPcopy Index your code
hub / github.com/google/go-github / TestNewUploadRequest_WithVersion

Function TestNewUploadRequest_WithVersion

github/github_test.go:1861–1876  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1859}
1860
1861func TestNewUploadRequest_WithVersion(t *testing.T) {
1862 t.Parallel()
1863 c := mustNewClient(t)
1864 req, _ := c.NewUploadRequest(t.Context(), "https://example.com/", nil, 0, "")
1865
1866 apiVersion := req.Header.Get(headerAPIVersion)
1867 if got, want := apiVersion, defaultAPIVersion; got != want {
1868 t.Errorf("NewRequest() %v header is %v, want %v", headerAPIVersion, got, want)
1869 }
1870
1871 req, _ = c.NewUploadRequest(t.Context(), "https://example.com/", nil, 0, "", WithVersion("2022-11-29"))
1872 apiVersion = req.Header.Get(headerAPIVersion)
1873 if got, want := apiVersion, "2022-11-29"; got != want {
1874 t.Errorf("NewRequest() %v header is %v, want %v", headerAPIVersion, got, want)
1875 }
1876}
1877
1878func TestNewUploadRequest_badURL(t *testing.T) {
1879 t.Parallel()

Callers

nothing calls this directly

Calls 4

mustNewClientFunction · 0.85
WithVersionFunction · 0.85
NewUploadRequestMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…