Download this file
| 1 | package host |
| 2 | |
| 3 | import "testing" |
| 4 | |
| 5 | // The member-facing refusal texts are approved copy (zdd.refuse.* |
| 6 | // and zdd.refuse.restart in the plan 6 copy list). The other tests compare |
| 7 | // against the constants, so this one pins the words themselves: a change here |
| 8 | // is a copy change and goes through review. |
| 9 | func TestRolloutRefusalDrafts(t *testing.T) { |
| 10 | for name, tc := range map[string]struct{ got, want string }{ |
| 11 | "no-store": {refuseTexts[rolloutNoStore], "this box cannot start instances right now: the deploy store is unavailable"}, |
| 12 | "no-release-key": {refuseTexts[rolloutNoReleaseKey], "this box cannot start instances right now: the release key is unavailable"}, |
| 13 | "book-unreadable": {refuseTexts[rolloutBookUnreadable], "this box cannot start instances right now: its record of failed builds cannot be read"}, |
| 14 | "no-swaps": {refuseNoSwaps, "this box cannot run two builds side by side, which this instance's build needs"}, |
| 15 | "restart": {rolloutRestartRefused, "restart refused: this box cannot restart instances right now"}, |
| 16 | } { |
| 17 | if tc.got != tc.want { |
| 18 | t.Errorf("%s: %q, want the draft %q", name, tc.got, tc.want) |
| 19 | } |
| 20 | } |
| 21 | } |
| 22 | |