def test_default_user(self): ''' Default user connection ''' self.conn.disconnect() test_util.enable_default_user() listener = base.WaitableListener() new_conn = stomp.Connection() new_conn.set_listener('', listener) new_conn.start() new_conn.connect() try: self.assertFalse(listener.await(3)) # no error back self.assertTrue(new_conn.is_connected()) finally: new_conn.disconnect() test_util.disable_default_user()
def test_default_user(self): ''' Default user connection ''' self.conn.disconnect() test_util.enable_default_user() listener = base.WaitableListener() new_conn = stomp.Connection(host_and_ports=[('localhost', int(os.environ["STOMP_PORT"]))]) new_conn.set_listener('', listener) new_conn.start() new_conn.connect() try: self.assertFalse(listener.await(3)) # no error back self.assertTrue(new_conn.is_connected()) finally: new_conn.disconnect() test_util.disable_default_user()
def test_default_user(self): ''' Default user connection ''' self.conn.disconnect() test_util.enable_default_user() listener = base.WaitableListener() new_conn = stomp.Connection( host_and_ports=[('localhost', int(os.environ["STOMP_PORT"]))]) new_conn.set_listener('', listener) new_conn.connect() try: self.assertFalse(listener.wait(3)) # no error back self.assertTrue(new_conn.is_connected()) finally: new_conn.disconnect() test_util.disable_default_user()
def test_default_user(self): ''' Default user connection ''' self.conn.disconnect() test_util.enable_default_user() listener = base.WaitableListener() new_conn = stomp.Connection() new_conn.set_listener('', listener) new_conn.start() new_conn.connect() try: self.assertFalse(listener. await (3)) # no error back self.assertTrue(new_conn.is_connected()) finally: new_conn.disconnect() test_util.disable_default_user()