(t *testing.T)
| 57 | } |
| 58 | |
| 59 | func TestConvertOptions(t *testing.T) { |
| 60 | opts := convertOptions( |
| 61 | []Option{ |
| 62 | WithURL("example://foo"), |
| 63 | WithAcceptHeader("Accept-Header"), |
| 64 | WithBasicAuth("username", "password"), |
| 65 | WithPassCredentialsAll(true), |
| 66 | WithUserAgent("User-agent"), |
| 67 | WithInsecureSkipVerifyTLS(true), |
| 68 | WithTLSClientConfig("certFile.pem", "keyFile.pem", "caFile.pem"), |
| 69 | WithPlainHTTP(true), |
| 70 | WithTimeout(10), |
| 71 | WithTagName("1.2.3"), |
| 72 | WithUntar(), |
| 73 | }, |
| 74 | []Option{ |
| 75 | WithTimeout(20), |
| 76 | }, |
| 77 | ) |
| 78 | |
| 79 | expected := schema.GetterOptionsV1{ |
| 80 | URL: "example://foo", |
| 81 | CertFile: "certFile.pem", |
| 82 | KeyFile: "keyFile.pem", |
| 83 | CAFile: "caFile.pem", |
| 84 | UNTar: true, |
| 85 | Timeout: 20, |
| 86 | InsecureSkipVerifyTLS: true, |
| 87 | PlainHTTP: true, |
| 88 | AcceptHeader: "Accept-Header", |
| 89 | Username: "username", |
| 90 | Password: "password", |
| 91 | PassCredentialsAll: true, |
| 92 | UserAgent: "User-agent", |
| 93 | Version: "1.2.3", |
| 94 | } |
| 95 | assert.Equal(t, expected, opts) |
| 96 | } |
| 97 | |
| 98 | type testPlugin struct { |
| 99 | t *testing.T |
nothing calls this directly
no test coverage detected
searching dependent graphs…