def test_ensure_flavor_profile(self):
     mock_nova, mock_flavor = self._create_flavor_mocks()
     undercloud._ensure_flavor(mock_nova, 'test', 'test')
     mock_nova.flavors.create.assert_called_with('test', 4096, 1, 40)
     keys = {
         'capabilities:boot_option': 'local',
         'capabilities:profile': 'test'
     }
     mock_flavor.set_keys.assert_called_with(keys)
 def test_ensure_flavor_exists(self):
     mock_nova, mock_flavor = self._create_flavor_mocks()
     mock_nova.flavors.create.side_effect = exceptions.Conflict(None)
     undercloud._ensure_flavor(mock_nova, 'test')
     mock_flavor.set_keys.assert_not_called()