

@mock.patch('sahara.utils.openstack.base.retrieve_auth_url')
def test_get_swift_configs(self, url_for_mock):
    url_for_mock.return_value = 'http://localhost:5000/v2.0'
    self.setup_context(tenant_name='test_tenant')
    self.override_config('os_region_name', 'regionOne')
    result = h.get_swift_configs()
    self.assertEqual(8, len(result))
    self.assertIn({
        'name': 'fs.swift.service.sahara.tenant',
        'value': 'test_tenant',
        'description': '',
    }, result)
    self.assertIn({
        'name': 'fs.swift.service.sahara.http.port',
        'value': '8080',
        'description': '',
    }, result)
    self.assertIn({
        'name': 'fs.swift.service.sahara.region',
        'value': 'regionOne',
        'description': '',
    }, result)

dataset/ETHPy150Open openstack/sahara/sahara/tests/unit/swift/test_swift_helper.py SwiftIntegrationTestCase.test_get_swift_configs/original