summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-03-09 01:42:28 +0000
committerGerrit Code Review <review@openstack.org>2013-03-09 01:42:28 +0000
commit55b248b6d509d8dc61ec0e4e6e6f05417b1b590e (patch)
treebda42c9e91e7f2ff11e4f317995904142b8e1b7a /nova/tests
parent7e96d76d762a67e534d769bc3e4e48adb56a130e (diff)
parent0ef60856fb2f1f1fd83647c3422e1b510a871ebd (diff)
Merge "Make 'os-hosts/node1' case sensitivity defer to DB"
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/compute/test_host_api.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/nova/tests/compute/test_host_api.py b/nova/tests/compute/test_host_api.py
index 3b5a9b871..38a7d2c37 100644
--- a/nova/tests/compute/test_host_api.py
+++ b/nova/tests/compute/test_host_api.py
@@ -38,8 +38,10 @@ class ComputeHostAPITestCase(test.TestCase):
"""Sets it so that the host API always thinks that 'fake_host'
exists.
"""
- self.mox.StubOutWithMock(self.host_api, '_assert_host_exists')
- self.host_api._assert_host_exists(self.ctxt, 'fake_host')
+ def fake_assert_host_exists(context, host_name):
+ return 'fake_host'
+ self.stubs.Set(self.host_api, '_assert_host_exists',
+ fake_assert_host_exists)
def test_set_host_enabled(self):
self._mock_assert_host_exists()
@@ -53,6 +55,18 @@ class ComputeHostAPITestCase(test.TestCase):
'fake_enabled')
self.assertEqual('fake-result', result)
+ def test_host_name_from_assert_hosts_exists(self):
+ self._mock_assert_host_exists()
+ self._mock_rpc_call(
+ {'method': 'set_host_enabled',
+ 'args': {'enabled': 'fake_enabled'},
+ 'version': compute_rpcapi.ComputeAPI.BASE_RPC_API_VERSION})
+
+ self.mox.ReplayAll()
+ result = self.host_api.set_host_enabled(self.ctxt, 'fake_hosT',
+ 'fake_enabled')
+ self.assertEqual('fake-result', result)
+
def test_get_host_uptime(self):
self._mock_assert_host_exists()
self._mock_rpc_call(