(t *testing.T)
| 145 | } |
| 146 | |
| 147 | func TestFormatUptime(t *testing.T) { |
| 148 | cases := []struct { |
| 149 | input int64 |
| 150 | want string |
| 151 | }{ |
| 152 | {0, "0s"}, |
| 153 | {45, "45s"}, |
| 154 | {90, "1m30s"}, |
| 155 | {3661, "1h1m"}, |
| 156 | {90061, "1d1h1m"}, |
| 157 | } |
| 158 | |
| 159 | for _, tc := range cases { |
| 160 | got := formatUptime(tc.input) |
| 161 | if got != tc.want { |
| 162 | t.Errorf("formatUptime(%d) = %q, want %q", tc.input, got, tc.want) |
| 163 | } |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | // newTestClient creates an api.Client pointing at the given httptest server URL. |
| 168 | // The server must respond to POST /api2/json/access/ticket with a valid auth response. |
nothing calls this directly
no test coverage detected