

@mock.patch('cloudferry.lib.os.compute.nova_compute.NovaCompute.create_flavor')
def test_access_list_is_updated_for_non_public_flavors(self, _):
    flavors = {
        'flavor1': {
            'flavor': {
                'is_public': False,
                'name': 'flavor1',
                'tenants': [],
                'ram': 48,
                'vcpus': 1,
                'disk': 0,
                'ephemeral': 1,
                'swap': 0,
                'rxtx_factor': 1.0,
            },
            'meta': {
                
            },
        },
    }
    tenant_map = {
        
    }
    config = mock.Mock()
    config.migrate.override_rules = None
    cloud = mock.MagicMock()
    cloud.position = 'dst'
    nc = nova_compute.NovaCompute(config, cloud)
    nc._create_flavor_if_not_exists = mock.Mock()
    nc._add_flavor_access_for_tenants = mock.Mock()
    nc.get_flavor_list = mock.Mock()
    nc.get_flavor_list.return_value = []
    nc._deploy_flavors(flavors, tenant_map)
    assert nc._add_flavor_access_for_tenants.called

dataset/ETHPy150Open MirantisWorkloadMobility/CloudFerry/tests/lib/os/compute/test_nova.py FlavorDeploymentTestCase.test_access_list_is_updated_for_non_public_flavors/original