(t *testing.T)
| 28 | } |
| 29 | |
| 30 | func TestPluginPush(t *testing.T) { |
| 31 | const expectedURL = "/plugins/plugin_name" |
| 32 | |
| 33 | client, err := New(WithMockClient(func(req *http.Request) (*http.Response, error) { |
| 34 | if err := assertRequest(req, http.MethodPost, expectedURL); err != nil { |
| 35 | return nil, err |
| 36 | } |
| 37 | auth := req.Header.Get(registry.AuthHeader) |
| 38 | if auth != "authtoken" { |
| 39 | return nil, fmt.Errorf("invalid auth header: expected 'authtoken', got %s", auth) |
| 40 | } |
| 41 | return mockResponse(http.StatusOK, nil, "")(req) |
| 42 | })) |
| 43 | assert.NilError(t, err) |
| 44 | |
| 45 | _, err = client.PluginPush(t.Context(), "plugin_name", PluginPushOptions{RegistryAuth: "authtoken"}) |
| 46 | assert.NilError(t, err) |
| 47 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…