diff --git a/os_client_config/tests/test_cloud_config.py b/os_client_config/tests/test_cloud_config.py index 42d6877..06ea0fd 100644 --- a/os_client_config/tests/test_cloud_config.py +++ b/os_client_config/tests/test_cloud_config.py @@ -161,63 +161,6 @@ class TestCloudConfig(base.TestCase): exceptions.OpenStackConfigException, cc.get_session) - @mock.patch.object(ksa_session, 'Session') - def test_get_session(self, mock_session): - config_dict = defaults.get_defaults() - config_dict.update(fake_services_dict) - fake_session = mock.Mock() - fake_session.additional_user_agent = [] - mock_session.return_value = fake_session - cc = cloud_config.CloudConfig( - "test1", "region-al", config_dict, auth_plugin=mock.Mock()) - cc.get_session() - mock_session.assert_called_with( - auth=mock.ANY, - verify=True, cert=None, timeout=None, discovery_cache=None) - self.assertEqual( - [('os-client-config', '1.2.3'), ('openstacksdk', '3.4.5')], - fake_session.additional_user_agent) - - @mock.patch.object(ksa_session, 'Session') - def test_get_session_with_app_name(self, mock_session): - config_dict = defaults.get_defaults() - config_dict.update(fake_services_dict) - fake_session = mock.Mock() - fake_session.additional_user_agent = [] - fake_session.app_name = None - fake_session.app_version = None - mock_session.return_value = fake_session - cc = cloud_config.CloudConfig( - "test1", "region-al", config_dict, auth_plugin=mock.Mock(), - app_name="test_app", app_version="test_version") - cc.get_session() - mock_session.assert_called_with( - auth=mock.ANY, - verify=True, cert=None, timeout=None, discovery_cache=None) - self.assertEqual(fake_session.app_name, "test_app") - self.assertEqual(fake_session.app_version, "test_version") - self.assertEqual( - [('os-client-config', '1.2.3'), ('openstacksdk', '3.4.5')], - fake_session.additional_user_agent) - - @mock.patch.object(ksa_session, 'Session') - def test_get_session_with_timeout(self, mock_session): - fake_session = mock.Mock() - fake_session.additional_user_agent = [] - mock_session.return_value = fake_session - config_dict = defaults.get_defaults() - config_dict.update(fake_services_dict) - config_dict['api_timeout'] = 9 - cc = cloud_config.CloudConfig( - "test1", "region-al", config_dict, auth_plugin=mock.Mock()) - cc.get_session() - mock_session.assert_called_with( - auth=mock.ANY, - verify=True, cert=None, timeout=9, discovery_cache=None) - self.assertEqual( - [('os-client-config', '1.2.3'), ('openstacksdk', '3.4.5')], - fake_session.additional_user_agent) - @mock.patch.object(ksa_session, 'Session') def test_override_session_endpoint_override(self, mock_session): config_dict = defaults.get_defaults()