MCPcopy
hub / github.com/dghubble/gologin / TestTokenHandler_NonPost

Function TestTokenHandler_NonPost

twitter/token_test.go:93–103  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

91}
92
93func TestTokenHandler_NonPost(t *testing.T) {
94 config := &oauth1.Config{}
95 ts := httptest.NewServer(TokenHandler(config, testutils.AssertSuccessNotCalled(t), nil))
96 resp, err := http.Get(ts.URL)
97 assert.Nil(t, err)
98 // assert that default (nil) failure handler returns a 405 Method Not Allowed
99 if assert.NotNil(t, resp) {
100 // TODO: change to 405
101 assert.Equal(t, http.StatusBadRequest, resp.StatusCode)
102 }
103}
104
105func TestTokenHandler_NonPostPassesError(t *testing.T) {
106 config := &oauth1.Config{}

Callers

nothing calls this directly

Calls 2

AssertSuccessNotCalledFunction · 0.92
TokenHandlerFunction · 0.85

Tested by

no test coverage detected