@@ -27,7 +27,7 @@ func TestConfig_RequestCode(t *testing.T) {
2727 defer teardown ()
2828
2929 mux .HandleFunc ("/api/private/unauth/account/device/authorize" , func (w http.ResponseWriter , r * http.Request ) {
30- testMethod (t , r , http . MethodPost )
30+ testMethod (t , r )
3131 fmt .Fprintf (w , `{
3232 "user_code": "QW3PYV7R",
3333 "verification_uri": "%s/account/connect",
@@ -60,7 +60,7 @@ func TestConfig_GetToken(t *testing.T) {
6060 defer teardown ()
6161
6262 mux .HandleFunc ("/api/private/unauth/account/device/token" , func (w http.ResponseWriter , r * http.Request ) {
63- testMethod (t , r , http . MethodPost )
63+ testMethod (t , r )
6464 fmt .Fprint (w , `{
6565 "access_token": "secret1",
6666 "refresh_token": "secret2",
@@ -99,7 +99,7 @@ func TestConfig_PollToken(t *testing.T) {
9999 defer teardown ()
100100
101101 mux .HandleFunc ("/api/private/unauth/account/device/token" , func (w http.ResponseWriter , r * http.Request ) {
102- testMethod (t , r , http . MethodPost )
102+ testMethod (t , r )
103103 fmt .Fprint (w , `{
104104 "access_token": "secret1",
105105 "refresh_token": "secret2",
@@ -132,3 +132,17 @@ func TestConfig_PollToken(t *testing.T) {
132132 t .Error (diff )
133133 }
134134}
135+
136+ func TestConfig_Revoke (t * testing.T ) {
137+ config , mux , teardown := setup ()
138+ defer teardown ()
139+
140+ mux .HandleFunc ("/api/private/unauth/account/device/revoke" , func (w http.ResponseWriter , r * http.Request ) {
141+ testMethod (t , r )
142+ })
143+
144+ _ , err := config .Revoke (ctx , "a" , "refresh_token" )
145+ if err != nil {
146+ t .Fatalf ("RequestCode returned error: %v" , err )
147+ }
148+ }
0 commit comments