from oslo_versionedobjects import fields
from cinder import objects
+from cinder.tests.unit import fake_constants as fake
def fake_db_consistencygroup(**updates):
db_values = {
- 'id': '1',
- 'user_id': '2',
- 'project_id': '3',
+ 'id': fake.consistency_group_id,
+ 'user_id': fake.user_id,
+ 'project_id': fake.project_id,
'host': 'FakeHost',
'volumes': [],
}
from cinder import exception
from cinder.scheduler import filters
from cinder import test
+from cinder.tests.unit import fake_constants as fake
from cinder.tests.unit.scheduler import fakes
from cinder.tests.unit import utils
def setUp(self):
super(HostFiltersTestCase, self).setUp()
- self.context = context.RequestContext('fake', 'fake')
+ self.context = context.RequestContext(fake.user_id, fake.project_id)
# This has a side effect of testing 'get_filter_classes'
# when specifying a method (in this case, our standard filters)
filter_handler = filters.HostFilterHandler('cinder.scheduler.filters')
from cinder.scheduler import manager
from cinder import test
from cinder.tests.unit import fake_consistencygroup
+from cinder.tests.unit import fake_constants as fake
from cinder.tests.unit import fake_volume
from cinder.tests.unit import utils as tests_utils
ex = exception.CinderException('test')
mock_cg.side_effect = ex
- group_id = '1'
+ group_id = fake.consistency_group_id
self.assertRaises(exception.CinderException,
self.manager.create_consistencygroup,
self.context,
def setUp(self):
super(SchedulerTestCase, self).setUp()
self.driver = self.driver_cls()
- self.context = context.RequestContext('fake_user', 'fake_project')
+ self.context = context.RequestContext(fake.user_id, fake.project_id)
self.topic = 'fake_topic'
@mock.patch('cinder.scheduler.driver.Scheduler.'
def setUp(self):
super(SchedulerDriverModuleTestCase, self).setUp()
- self.context = context.RequestContext('fake_user', 'fake_project')
+ self.context = context.RequestContext(fake.user_id, fake.project_id)
@mock.patch('cinder.db.volume_update')
@mock.patch('cinder.objects.volume.Volume.get_by_id')