

def test_adds_region_if_set_in_config(self, n_client):
    cloud = mock.MagicMock()
    config = mock.MagicMock()
    tenant = 'tenant'
    region = 'region'
    user = 'user'
    auth_url = 'auth_url'
    password = 'password'
    insecure = False
    cacert = ''
    config.cloud.user = user
    config.cloud.tenant = tenant
    config.cloud.region = region
    config.cloud.auth_url = auth_url
    config.cloud.password = password
    config.cloud.insecure = insecure
    config.cloud.cacert = cacert
    config.migrate.override_rules = None
    cloud.position = 'src'
    n = nova_compute.NovaCompute(config, cloud)
    n.get_client()
    n_client.assert_called_with(user, password, tenant, auth_url, region_name=region, cacert=cacert, insecure=insecure)

dataset/ETHPy150Open MirantisWorkloadMobility/CloudFerry/tests/lib/os/compute/test_nova.py NovaClientTestCase.test_adds_region_if_set_in_config/original