Esempio n. 1
0
File: disco.py Progetto: dax/jcl
 def setUp(self):
     JCLTestCase.setUp(self, tables=[User, Account, ExampleAccount])
     self.comp = JCLComponent("jcl.test.com",
                              "password",
                              "localhost",
                              "5347",
                              self.db_url)
     self.comp.account_manager.account_classes = (ExampleAccount,)
     self.handler = AccountTypeDiscoGetItemsHandler(self.comp)
Esempio n. 2
0
File: disco.py Progetto: dax/jcl
class AccountTypeDiscoGetItemsHandler_TestCase (JCLTestCase):
    """Test AccountTypeDiscoGetItemsHandler class"""
    def setUp(self):
        JCLTestCase.setUp(self, tables=[User, Account, ExampleAccount])
        self.comp = JCLComponent("jcl.test.com",
                                 "password",
                                 "localhost",
                                 "5347",
                                 self.db_url)
        self.comp.account_manager.account_classes = (ExampleAccount,)
        self.handler = AccountTypeDiscoGetItemsHandler(self.comp)

    def test_handler_unknown_account_type(self):
        """Test handler with an unknown account type"""
        self.assertEquals(self.handler.handle(Message(from_jid="*****@*****.**"),
                                              None, None, None,
                                              "Unknown"), [])