File: authorization_test.go

package info (click to toggle)
golang-github-eggsampler-acme 3.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 312 kB
  • sloc: makefile: 47
file content (30 lines) | stat: -rw-r--r-- 781 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package acme

import "testing"

func TestClient_FetchAuthorization(t *testing.T) {
	account, order := makeOrder(t)

	auth, err := testClient.FetchAuthorization(account, order.Authorizations[0])
	if err != nil {
		t.Fatalf("unexpected error fetching authorization: %v", err)
	}
	if auth.Status != "pending" {
		t.Fatalf("unexpected auth status: %s", auth.Status)
	}
	if len(auth.Challenges) == 0 {
		t.Fatalf("no challenges on auth")
	}
}

func TestClient_DeactivateAuthorization(t *testing.T) {
	account, order := makeOrder(t)

	auth, err := testClient.DeactivateAuthorization(account, order.Authorizations[0])
	if err != nil {
		t.Fatalf("expected no error, got: %v", err)
	}
	if auth.Status != "deactivated" {
		t.Fatalf("expected deactivated status, got: %s", auth.Status)
	}
}