'Cleans up the test server. This method should not be called manually,
it is added to the cleanup queue in the _setup method already.'

def _cleanup(self):

    if ((self.client is not None) and (self.client.state != 'LOGOUT')):
        self.client.shutdown()
    self.server.shutdown()
    self.server.server_close()
    self.thread.join(3.0)
