]> diplodocus.org Git - nmh/blobdiff - test/oauth/test-share
sbr: Replace some ints that are only ever 0 or 1 with bool.
[nmh] / test / oauth / test-share
index 76b0d3e2e76b549cadcf9e93c5f8ef63411fd5e1..10aa913ab3e9d593e9b01c1f7c6998b17c1ffb5f 100755 (executable)
@@ -29,12 +29,12 @@ fake_json_response <<EOF
 EOF
 
 expect_creds <<EOF
-access: test-access
-expire:
+access-nobody@example.com: test-access
+expire-nobody@example.com:
 EOF
 
 start_fakehttp
-run_test 'eval echo code | mhlogin -saslmech xoauth2 -authservice test' \
+run_test 'eval echo code | mhlogin -user nobody@example.com -saslmech xoauth2 -authservice test' \
 "Load the following URL in your browser and authorize nmh to access test:
 
 http://127.0.0.1:${http_port}/oauth/auth?response_type=code&client_id=test-id&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=test-scope
@@ -42,7 +42,7 @@ http://127.0.0.1:${http_port}/oauth/auth?response_type=code&client_id=test-id&re
 Enter the authorization code: "
 
 start_pop_xoauth
-run_test "msgchk -host 127.0.0.1 -port ${pop_port} -saslmech xoauth2 -authservice test -user nobody@example.com" 'nobody@example.com has 1 message (178 bytes) on 127.0.0.1'
+run_test "msgchk -host 127.0.0.1 -port ${pop_port} -sasl -saslmech xoauth2 -authservice test -user nobody@example.com" 'nobody@example.com has 1 message (178 bytes) on 127.0.0.1'
 
 start_pop_xoauth
 test_inc_success
@@ -54,9 +54,9 @@ test_send_only_fakesmtp
 start_test 'inc refreshes'
 
 fake_creds <<EOF
-access: old-access
-refresh: test-refresh
-expire: 1414303986
+access-nobody@example.com: old-access
+refresh-nobody@example.com: test-refresh
+expire-nobody@example.com: 1414303986
 EOF
 
 expect_http_post_refresh
@@ -74,7 +74,7 @@ start_pop_xoauth
 test_inc_success
 
 start_pop_xoauth
-run_test "msgchk -host 127.0.0.1 -port ${pop_port} -saslmech oauth2 -authservice test -user nobody@example.com" 'nobody@example.com has 1 message (178 bytes) on 127.0.0.1'
+run_test "msgchk -host 127.0.0.1 -port ${pop_port} -sasl -saslmech xoauth2 -authservice test -user nobody@example.com" 'nobody@example.com has 1 message (178 bytes) on 127.0.0.1'
 
 setup_draft
 test_send_only_fakesmtp
@@ -83,9 +83,9 @@ test_send_only_fakesmtp
 start_test 'msgchck refreshes'
 
 fake_creds <<EOF
-access: old-access
-refresh: test-refresh
-expire: 1414303986
+access-nobody@example.com: old-access
+refresh-nobody@example.com: test-refresh
+expire-nobody@example.com: 1414303986
 EOF
 
 expect_http_post_refresh
@@ -100,7 +100,7 @@ EOF
 
 start_fakehttp
 start_pop_xoauth
-run_test "msgchk -host 127.0.0.1 -port ${pop_port} -saslmech xoauth2 -authservice test -user nobody@example.com" 'nobody@example.com has 1 message (178 bytes) on 127.0.0.1'
+run_test "msgchk -host 127.0.0.1 -port ${pop_port} -sasl -saslmech xoauth2 -authservice test -user nobody@example.com" 'nobody@example.com has 1 message (178 bytes) on 127.0.0.1'
 
 start_pop_xoauth
 test_inc_success
@@ -112,9 +112,9 @@ test_send_only_fakesmtp
 start_test 'send refreshes'
 
 fake_creds <<EOF
-access: old-access
-refresh: test-refresh
-expire: 1414303986
+access-nobody@example.com: old-access
+refresh-nobody@example.com: test-refresh
+expire-nobody@example.com: 1414303986
 EOF
 
 expect_http_post_refresh
@@ -131,7 +131,7 @@ setup_draft
 test_send
 
 start_pop_xoauth
-run_test "msgchk -host 127.0.0.1 -port ${pop_port} -saslmech xoauth2 -authservice test -user nobody@example.com" 'nobody@example.com has 1 message (178 bytes) on 127.0.0.1'
+run_test "msgchk -host 127.0.0.1 -port ${pop_port} -sasl -saslmech xoauth2 -authservice test -user nobody@example.com" 'nobody@example.com has 1 message (178 bytes) on 127.0.0.1'
 
 start_pop_xoauth
 test_inc_success