Merge "Tenant id filter test is not correct"

This commit is contained in:
Jenkins 2013-09-01 14:06:13 +00:00 committed by Gerrit Code Review
commit 2e359c3f2a
2 changed files with 6 additions and 4 deletions

View File

@ -668,14 +668,15 @@ class ServersControllerTest(ControllerTest):
sort_dir='desc', limit=None, marker=None,
columns_to_join=None):
self.assertNotEqual(filters, None)
self.assertEqual(filters['project_id'], 'fake')
self.assertEqual(filters['project_id'], 'newfake')
self.assertFalse(filters.get('tenant_id'))
return [fakes.stub_instance(100)]
self.stubs.Set(db, 'instance_get_all_by_filters',
fake_get_all)
req = fakes.HTTPRequestV3.blank('/servers?tenant_id=fake',
req = fakes.HTTPRequestV3.blank('/servers'
'?all_tenants=1&tenant_id=newfake',
use_admin_context=True)
res = self.controller.index(req)

View File

@ -651,14 +651,15 @@ class ServersControllerTest(ControllerTest):
sort_dir='desc', limit=None, marker=None,
columns_to_join=None):
self.assertNotEqual(filters, None)
self.assertEqual(filters['project_id'], 'fake')
self.assertEqual(filters['project_id'], 'newfake')
self.assertFalse(filters.get('tenant_id'))
return [fakes.stub_instance(100)]
self.stubs.Set(db, 'instance_get_all_by_filters',
fake_get_all)
req = fakes.HTTPRequest.blank('/fake/servers?tenant_id=fake',
req = fakes.HTTPRequest.blank('/fake/servers'
'?all_tenants=1&tenant_id=newfake',
use_admin_context=True)
res = self.controller.index(req)