Test DiscoIdentity component name
darcs-hash:20070321172639-86b55-5b6da4fc5c905e26b60f414012590ee3a70f2d66.gz
This commit is contained in:
@@ -253,7 +253,7 @@ class JCLComponent(Component, object):
|
|||||||
disco_info.add_feature("jabber:iq:version")
|
disco_info.add_feature("jabber:iq:version")
|
||||||
if len(self.account_classes) == 1:
|
if len(self.account_classes) == 1:
|
||||||
disco_info.add_feature("jabber:iq:register")
|
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.category,
|
||||||
self.disco_identity.type)
|
self.disco_identity.type)
|
||||||
return disco_info
|
return disco_info
|
||||||
|
|||||||
@@ -353,12 +353,14 @@ class JCLComponent_TestCase(unittest.TestCase):
|
|||||||
###########################################################################
|
###########################################################################
|
||||||
def test_disco_get_info(self):
|
def test_disco_get_info(self):
|
||||||
disco_info = self.comp.disco_get_info(None, None)
|
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:version"))
|
||||||
self.assertTrue(disco_info.has_feature("jabber:iq:register"))
|
self.assertTrue(disco_info.has_feature("jabber:iq:register"))
|
||||||
|
|
||||||
def test_disco_get_info_multiple_account_type(self):
|
def test_disco_get_info_multiple_account_type(self):
|
||||||
self.comp.account_classes = [ExampleAccount, Example2Account]
|
self.comp.account_classes = [ExampleAccount, Example2Account]
|
||||||
disco_info = self.comp.disco_get_info(None, None)
|
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:version"))
|
||||||
self.assertFalse(disco_info.has_feature("jabber:iq:register"))
|
self.assertFalse(disco_info.has_feature("jabber:iq:register"))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user