From 6753545187e9d98ea98a20d16e1bd4f789f4686e Mon Sep 17 00:00:00 2001 From: David Rousselie Date: Wed, 21 Mar 2007 18:26:39 +0100 Subject: [PATCH] Test DiscoIdentity component name darcs-hash:20070321172639-86b55-5b6da4fc5c905e26b60f414012590ee3a70f2d66.gz --- src/jcl/jabber/component.py | 2 +- tests/jcl/jabber/test_component.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/jcl/jabber/component.py b/src/jcl/jabber/component.py index 5c8197a..998fa18 100644 --- a/src/jcl/jabber/component.py +++ b/src/jcl/jabber/component.py @@ -253,7 +253,7 @@ class JCLComponent(Component, object): disco_info.add_feature("jabber:iq:version") if len(self.account_classes) == 1: disco_info.add_feature("jabber:iq:register") - DiscoIdentity(disco_info, self.disco_identity.name, + DiscoIdentity(disco_info, self.name, self.disco_identity.category, self.disco_identity.type) return disco_info diff --git a/tests/jcl/jabber/test_component.py b/tests/jcl/jabber/test_component.py index 16f3a20..23eb651 100644 --- a/tests/jcl/jabber/test_component.py +++ b/tests/jcl/jabber/test_component.py @@ -353,12 +353,14 @@ class JCLComponent_TestCase(unittest.TestCase): ########################################################################### def test_disco_get_info(self): disco_info = self.comp.disco_get_info(None, None) + self.assertEquals(disco_info.get_identities()[0].get_name(), self.comp.name) self.assertTrue(disco_info.has_feature("jabber:iq:version")) self.assertTrue(disco_info.has_feature("jabber:iq:register")) def test_disco_get_info_multiple_account_type(self): self.comp.account_classes = [ExampleAccount, Example2Account] disco_info = self.comp.disco_get_info(None, None) + self.assertEquals(disco_info.get_identities()[0].get_name(), self.comp.name) self.assertTrue(disco_info.has_feature("jabber:iq:version")) self.assertFalse(disco_info.has_feature("jabber:iq:register"))