]> diplodocus.org Git - nmh/commitdiff
Added test of negative return code from jsmn_parse() to test-send.
authorDavid Levine <david.levine@gonift.com>
Tue, 26 Apr 2016 02:20:39 +0000 (22:20 -0400)
committerDavid Levine <david.levine@gonift.com>
Tue, 26 Apr 2016 02:20:39 +0000 (22:20 -0400)
test/oauth/test-send

index d75901ad393a642444c5a65218d62e3fc0eb837e..ad40dbdd3cbdc42f4638759cf7410946a73ec62f 100755 (executable)
@@ -355,6 +355,24 @@ unset XOAUTH
 test_send_only_fakesmtp 'post: problem initializing server; [BHST] SMTP server does not support SASL XOAUTH2
 send: message not delivered to anyone'
 
 test_send_only_fakesmtp 'post: problem initializing server; [BHST] SMTP server does not support SASL XOAUTH2
 send: message not delivered to anyone'
 
+# TEST
+start_test 'botched json response'
+
+fake_creds <<EOF
+refresh-nobody@example.com: test-refresh
+EOF
+
+expect_http_post_refresh
+
+fake_json_response <<EOF
+{
+  "refresh_token": "refresh-toke
+}
+EOF
+
+test_send_only_fakehttp 'send: error refreshing OAuth2 token
+send: invalid response'
+
 clean_fakesmtp
 clean_fakehttp
 finish_test
 clean_fakesmtp
 clean_fakehttp
 finish_test