def test_session_returns_stored_value_after_initial_creation(self):
     """
     Test that a previously created session is stored/returned when session property is called
     """
     previous_session = mock.Mock('previous-session')
     context = RequestContext(self.auth_token, self.base_api_url)
     context.session = previous_session  # Use setter to establish a stored value
     self.assertEqual(previous_session, context.session,
                      "Prior stored session should be returned by a subsequent call to session property")
 def test_expire_session_clears_stored_session(self):
     """
     Test that a previously created session is cleared out when calling expire_session
     """
     previous_session = mock.Mock('previous-session')
     context = RequestContext(self.auth_token, self.base_api_url)
     context.session = previous_session  # Use setter to establish a stored value
     context.expire_session()
     self.assertNotEqual(previous_session, context.session,
                         "Prior stored session should have been cleared out after call to expire_session")
Beispiel #3
0
 def test_session_returns_stored_value_after_initial_creation(self):
     """
     Test that a previously created session is stored/returned when session property is called
     """
     previous_session = mock.Mock('previous-session')
     context = RequestContext(self.auth_token, self.base_api_url)
     context.session = previous_session  # Use setter to establish a stored value
     self.assertEqual(
         previous_session, context.session,
         "Prior stored session should be returned by a subsequent call to session property"
     )
Beispiel #4
0
 def test_expire_session_clears_stored_session(self):
     """
     Test that a previously created session is cleared out when calling expire_session
     """
     previous_session = mock.Mock('previous-session')
     context = RequestContext(self.auth_token, self.base_api_url)
     context.session = previous_session  # Use setter to establish a stored value
     context.expire_session()
     self.assertNotEqual(
         previous_session, context.session,
         "Prior stored session should have been cleared out after call to expire_session"
     )