summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJoe Gordon <jogo@cloudscaling.com>2013-02-05 18:12:02 -0800
committerJoe Gordon <jogo@cloudscaling.com>2013-02-08 12:15:46 -0800
commit6ff32210772a67a1b526d9d784030afc90f3ce99 (patch)
tree19532173de03e64507b64c289c2e680b81bb5e26 /nova/tests
parentdaddc54befea4414776368b0ae8f689872b21e27 (diff)
Use joined version of db.api calls
Replace db.instance_get_active_by_window with db.instance_get_active_by_window_joined Remove db.instance_get_active_by_window as it is now unused When moving over to nova.db.api not returning sqlalchemy objects non-joined db calls (lazy loaded) won't work. Partially implements bp db-api-cleanup Change-Id: Iec647792a049d53862a45f95accd7f46e483aa17
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/api/openstack/compute/contrib/test_simple_tenant_usage.py5
-rw-r--r--nova/tests/conductor/test_conductor.py10
2 files changed, 3 insertions, 12 deletions
diff --git a/nova/tests/api/openstack/compute/contrib/test_simple_tenant_usage.py b/nova/tests/api/openstack/compute/contrib/test_simple_tenant_usage.py
index 13a4e9d61..440c97fbd 100644
--- a/nova/tests/api/openstack/compute/contrib/test_simple_tenant_usage.py
+++ b/nova/tests/api/openstack/compute/contrib/test_simple_tenant_usage.py
@@ -65,7 +65,8 @@ def get_fake_db_instance(start, end, instance_id, tenant_id):
'terminated_at': end}
-def fake_instance_get_active_by_window(self, context, begin, end, project_id):
+def fake_instance_get_active_by_window_joined(self, context, begin, end,
+ project_id):
return [get_fake_db_instance(START,
STOP,
x,
@@ -79,7 +80,7 @@ class SimpleTenantUsageTest(test.TestCase):
self.stubs.Set(api.API, "get_instance_type",
fake_instance_type_get)
self.stubs.Set(api.API, "get_active_by_window",
- fake_instance_get_active_by_window)
+ fake_instance_get_active_by_window_joined)
self.admin_context = context.RequestContext('fakeadmin_0',
'faketenant_0',
is_admin=True)
diff --git a/nova/tests/conductor/test_conductor.py b/nova/tests/conductor/test_conductor.py
index 773b65d43..d4d0fc3bb 100644
--- a/nova/tests/conductor/test_conductor.py
+++ b/nova/tests/conductor/test_conductor.py
@@ -335,16 +335,6 @@ class _BaseTestCase(object):
self.mox.ReplayAll()
self.conductor.instance_get_all_hung_in_rebooting(self.context, 123)
- def test_instance_get_active_by_window(self):
- self.mox.StubOutWithMock(db, 'instance_get_active_by_window_joined')
- db.instance_get_active_by_window(self.context, 'fake-begin',
- 'fake-end', 'fake-proj',
- 'fake-host')
- self.mox.ReplayAll()
- self.conductor.instance_get_active_by_window(self.context,
- 'fake-begin', 'fake-end',
- 'fake-proj', 'fake-host')
-
def test_instance_get_active_by_window_joined(self):
self.mox.StubOutWithMock(db, 'instance_get_active_by_window_joined')
db.instance_get_active_by_window_joined(self.context, 'fake-begin',