예제 #1
0
 def test_successful_sierra_sesssion_instance_has_access_token_parameter(
         self):
     with SierraSession(self.base, self.key, self.secret) as session:
         self.assertIsInstance(session.access_token, str)
예제 #2
0
 def test_session_with_invalid_secret_raises_exception(self):
     secret = 'invalid secret'
     with self.assertRaises(MissingTokenError):
         with SierraSession(self.base, self.key, secret) as session:
             pass
예제 #3
0
 def test_successful_sierra_session(self):
     with SierraSession(self.base, self.key, self.secret) as session:
         self.assertIsInstance(session.token, OAuth2Token)
예제 #4
0
 def test_session_with_incorrect_key_raises_exception(self):
     with self.assertRaises(MissingTokenError):
         with SierraSession(self.base, 'invalid_key', self.secret):
             pass
예제 #5
0
 def test_session_with_secret_none_raises_exception(self):
     key = 'some_key'
     secret = None
     with self.assertRaises(TypeError):
         with SierraSession(self.base, key, secret):
             pass
예제 #6
0
 def test_session_with_key_none_raises_exception(self):
     key = None
     secret = 'some_secret'
     with self.assertRaises(TypeError):
         with SierraSession(self.base, key, secret) as session:
             pass
예제 #7
0
 def test_session_without_base_url(self):
     with self.assertRaises(TypeError):
         with SierraSession(None, self.key, self.secret) as session:
             pass
예제 #8
0
 def test_session_without_parameters(self):
     with self.assertRaises(TypeError):
         with SierraSession() as session:
             pass