summaryrefslogtreecommitdiff
path: root/nova/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'nova/tests/unit')
-rw-r--r--nova/tests/unit/test_service.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/nova/tests/unit/test_service.py b/nova/tests/unit/test_service.py
index 07063c9c4d..22fe864f47 100644
--- a/nova/tests/unit/test_service.py
+++ b/nova/tests/unit/test_service.py
@@ -109,6 +109,17 @@ class ServiceTestCase(test.NoDBTestCase):
self.assertTrue(app)
+ def test_repr(self):
+ # Test if a Service object is correctly represented, for example in
+ # log files.
+ serv = service.Service(self.host,
+ self.binary,
+ self.topic,
+ 'nova.tests.unit.test_service.FakeManager')
+ exp = "<Service: host=foo, binary=nova-fake, " \
+ "manager_class_name=nova.tests.unit.test_service.FakeManager>"
+ self.assertEqual(exp, repr(serv))
+
def _service_start_mocks(self):
self.mox.StubOutWithMock(objects.Service, 'create')
self.mox.StubOutWithMock(objects.Service, 'get_by_host_and_binary')