Remove app_name config tests
These are testing that an underlying method is being called with a set of parameters but the method isn't implemented in this library. Change-Id: I29d354f7584d783104220a797ef9cf97bcc490a2
This commit is contained in:
parent
2c2305e141
commit
46ac30df8e
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user