Beispiel #1
0
 def test_no_auth(self, mock_load_session, mock_load_auth):
     # no auth, yes session, yes session.auth
     actual = utils._get_auth_and_session(self.test_confgrp,
                                          ksa_auth=None,
                                          ksa_session=self.mock_session)
     self.assertEqual(actual, (self.test_session_auth, self.mock_session))
     mock_load_session.assert_not_called()
     mock_load_auth.assert_not_called()
Beispiel #2
0
 def test_no_auth_no_sauth(self, mock_CONF, mock_load_session,
                           mock_load_auth):
     # no auth, yes session, no session.auth
     mock_load_auth.return_value = self.test_auth
     self.mock_session.auth = None
     actual = utils._get_auth_and_session(self.test_confgrp,
                                          ksa_auth=None,
                                          ksa_session=self.mock_session)
     self.assertEqual(actual, (self.test_auth, self.mock_session))
     mock_load_session.assert_not_called()
     mock_load_auth.assert_called_once_with(mock_CONF, self.test_confgrp)
Beispiel #3
0
 def test__get_auth_and_session(self, mock_CONF, mock_load_session,
                                mock_load_auth):
     # no auth, no session
     mock_load_auth.return_value = self.test_auth
     mock_load_session.return_value = self.test_session
     actual = utils._get_auth_and_session(self.test_confgrp,
                                          ksa_auth=None,
                                          ksa_session=None)
     self.assertEqual(actual, (self.test_auth, self.test_session))
     mock_load_session.assert_called_once_with(mock_CONF,
                                               self.test_confgrp,
                                               auth=self.test_auth)
     mock_load_auth.assert_called_once_with(mock_CONF, self.test_confgrp)