Package integration :: Module test_xmpp_client_nb :: Class TestNonBlockingClient
[hide private]
[frames] | no frames]

Class TestNonBlockingClient

source code


Test Cases class for NonBlockingClient.
Nested Classes [hide private]

Inherited from unittest.TestCase: failureException

Instance Methods [hide private]
 
setUp(self)
IdleQueue thread is run and dummy connection is created.
source code
 
tearDown(self)
IdleQueue thread is stopped.
source code
 
open_stream(self, server_port, wrong_pass=False)
Method opening the XMPP connection.
source code
 
client_auth(self, username, password, resource, sasl)
Method authenticating connected client with supplied credentials.
source code
 
do_disconnect(self)
Does disconnecting of connected client.
source code
 
test_proper_connect_sasl(self)
The ideal testcase - client is connected, authenticated with SASL and then disconnected.
source code
 
test_proper_connect_oldauth(self)
The ideal testcase - client is connected, authenticated with old auth and then disconnected.
source code
 
test_connect_to_nonexisting_host(self)
Connect to nonexisting host.
source code
 
test_connect_to_wrong_port(self)
Connect to nonexisting server.
source code
 
test_connect_with_wrong_creds(self)
Connecting with invalid password.
source code

Inherited from unittest.TestCase: __call__, __init__, __repr__, __str__, assertAlmostEqual, assertAlmostEquals, assertEqual, assertEquals, assertFalse, assertNotAlmostEqual, assertNotAlmostEquals, assertNotEqual, assertNotEquals, assertRaises, assertTrue, assert_, countTestCases, debug, defaultTestResult, fail, failIf, failIfAlmostEqual, failIfEqual, failUnless, failUnlessAlmostEqual, failUnlessEqual, failUnlessRaises, id, run, shortDescription

Inherited from unittest.TestCase (private): _exc_info

Method Details [hide private]

setUp(self)

source code 
IdleQueue thread is run and dummy connection is created.
Overrides: unittest.TestCase.setUp

tearDown(self)

source code 
IdleQueue thread is stopped.
Overrides: unittest.TestCase.tearDown

open_stream(self, server_port, wrong_pass=False)

source code 

Method opening the XMPP connection. It returns when <stream:features> is received from server.

connect.

Parameters:
  • server_port - tuple of (hostname, port) for where the client should

client_auth(self, username, password, resource, sasl)

source code 
Method authenticating connected client with supplied credentials. Returns when authentication is over.
Parameters:
  • sasl - whether to use sasl (sasl=1) or old (sasl=0) authentication

To Do: to check and be more specific about when it returns (bind, session..)

do_disconnect(self)

source code 
Does disconnecting of connected client. Returns when TCP connection is closed.

test_proper_connect_sasl(self)

source code 
The ideal testcase - client is connected, authenticated with SASL and then disconnected.

test_proper_connect_oldauth(self)

source code 
The ideal testcase - client is connected, authenticated with old auth and then disconnected.

test_connect_to_nonexisting_host(self)

source code 
Connect to nonexisting host. DNS request for A records should return nothing.

test_connect_to_wrong_port(self)

source code 
Connect to nonexisting server. DNS request for A records should return an IP but there shouldn't be XMPP server running on specified port.

test_connect_with_wrong_creds(self)

source code 
Connecting with invalid password.