Пример #1
0
class test_connection:
    def setUp(self):
        self.jid = "[email protected]/HermesClient"
        self.password = "******"
        self.endpoint = ("zuwiki.net", 5222)
        self.dispatcher = Dispatcher(self.jid, self.password, self.endpoint)

    def test_should_connect_with_jid_and_password(self):
        assert self.dispatcher.fulljid == self.jid
        assert self.dispatcher.connect()
        assert self.dispatcher.state["connected"]

    def test_should_fail_peacefully_without_jid_or_password(self):
        dispatcher = Dispatcher()
        assert dispatcher.connect() == False
Пример #2
0
 def test_should_fail_peacefully_without_jid_or_password(self):
     dispatcher = Dispatcher()
     assert dispatcher.connect() == False