(t *testing.T)
| 124 | } |
| 125 | |
| 126 | func TestRESTPrefix(t *testing.T) { |
| 127 | tests := []struct { |
| 128 | host string |
| 129 | want string |
| 130 | }{ |
| 131 | { |
| 132 | host: "github.com", |
| 133 | want: "https://api.github.com/", |
| 134 | }, |
| 135 | { |
| 136 | host: "github.localhost", |
| 137 | want: "http://api.github.localhost/", |
| 138 | }, |
| 139 | { |
| 140 | host: "garage.github.com", |
| 141 | want: "https://garage.github.com/api/v3/", |
| 142 | }, |
| 143 | { |
| 144 | host: "ghe.io", |
| 145 | want: "https://ghe.io/api/v3/", |
| 146 | }, |
| 147 | { |
| 148 | host: "tenant.ghe.com", |
| 149 | want: "https://api.tenant.ghe.com/", |
| 150 | }, |
| 151 | } |
| 152 | for _, tt := range tests { |
| 153 | t.Run(tt.host, func(t *testing.T) { |
| 154 | if got := RESTPrefix(tt.host); got != tt.want { |
| 155 | t.Errorf("RESTPrefix() = %v, want %v", got, tt.want) |
| 156 | } |
| 157 | }) |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | func TestCategorizeHost(t *testing.T) { |
| 162 | tests := []struct { |
nothing calls this directly
no test coverage detected