Пример #1
0
    def test_username_api_key(self, config_parser):
        result = get_client_settings_config_file()

        self.assertEqual(result['endpoint_url'], config_parser().get())
        self.assertEqual(result['timeout'], config_parser().get())
        self.assertEqual(result['auth'].username, config_parser().get())
        self.assertEqual(result['auth'].api_key, config_parser().get())
Пример #2
0
    def test_username_api_key(self, config_parser):
        result = config.get_client_settings_config_file()

        self.assertEqual(result['endpoint_url'], config_parser().get())
        self.assertEqual(result['timeout'], config_parser().getfloat())
        self.assertEqual(result['proxy'], config_parser().get())
        self.assertEqual(result['username'], config_parser().get())
        self.assertEqual(result['api_key'], config_parser().get())
    def test_username_api_key(self, config_parser):
        result = config.get_client_settings_config_file()

        self.assertEqual(result['endpoint_url'], config_parser().get())
        self.assertEqual(result['timeout'], config_parser().getfloat())
        self.assertEqual(result['proxy'], config_parser().get())
        self.assertEqual(result['username'], config_parser().get())
        self.assertEqual(result['api_key'], config_parser().get())
    def test_username_api_key(self, config_parser):
        result = get_client_settings_config_file()

        self.assertEqual(result["endpoint_url"], config_parser().get())
        self.assertEqual(result["timeout"], config_parser().get())
        self.assertEqual(result["proxy"], config_parser().get())
        self.assertEqual(result["auth"].username, config_parser().get())
        self.assertEqual(result["auth"].api_key, config_parser().get())
Пример #5
0
 def __init__(self, swift_username, swift_auth_url=default_swift_url):
     self.conf = config.get_client_settings_config_file()
     self.swift_username = swift_username
     self.sl_client = sl.create_client_from_env()
     self.images = sl.ImageManager(self.sl_client)
     self.servers = sl.VSManager(self.sl_client)
     self.swift = client.Connection(authurl=swift_auth_url,
                                    user=swift_username,
                                    key=self.conf['api_key'])
Пример #6
0
def test_config_file(config_parser):
    config.get_client_settings_config_file(config_file='path/to/config')
    config_parser().read.assert_called_with(
        [mock.ANY, mock.ANY, 'path/to/config'])
Пример #7
0
    def test_no_section(self, config_parser):
        config_parser().has_section.return_value = False
        result = config.get_client_settings_config_file()

        self.assertIsNone(result)
Пример #8
0
 def test_config_file(self, config_parser):
     get_client_settings_config_file(config_file='path/to/config')
     config_parser().read.assert_called_with([ANY, ANY, 'path/to/config'])
Пример #9
0
    def test_no_section(self, config_parser):
        config_parser().has_section.return_value = False
        result = get_client_settings_config_file()

        self.assertIsNone(result)
def test_config_file(config_parser):
    config.get_client_settings_config_file(config_file='path/to/config')
    config_parser().read.assert_called_with([mock.ANY,
                                             mock.ANY,
                                             'path/to/config'])