We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d5157c5 commit 6dd329dCopy full SHA for 6dd329d
tests/test_credentials.py
@@ -1,6 +1,8 @@
1
-from nose.tools import assert_equal
+from nose.tools import assert_equal, assert_raises
2
+from mock import patch
3
-from twilio.rest import find_credentials
4
+from twilio import TwilioException
5
+from twilio.rest import TwilioRestClient, find_credentials
6
7
def test_creds_not_found():
8
""" I shouldn't find credentials if they are not there """
@@ -15,3 +17,8 @@ def test_find_creds():
15
17
}
16
18
assert_equal(find_credentials(env), ('AC123', '456'))
19
20
+@patch("twilio.rest.find_credentials")
21
+def test_creds_error(creds):
22
+ creds.return_value = (None, None)
23
+ assert_raises(TwilioException, TwilioRestClient)
24
+
0 commit comments