def _process_info(self, info): '''\ process server infomation message; Params: ===== info: nats server information ''' server_info = json.loads(info) if server_info["auth_required"]: conn_opts = self.conn.get_connection_options() self.conn.send_command(Protocol.connect_command(conn_opts), True)
def _process_info(self, info): '''\ process server infomation message; Params: ===== info: nats server information ''' server_info = json.loads(info) if server_info["auth_required"]: conn_opts = self.conn.get_connection_options() self.conn.send_command(Protocol.connect_command(conn_opts), True)
def test_connect_command(self): 'should return the connect command' opts = {'user': '******', 'pass': '******'} self.assertEqual(Protocol.connect_command(opts), 'CONNECT {"user": "******", "pass": "******"}\r\n')
def test_connect_command(self): 'should return the connect command' opts = {'user' : 'a', 'pass' : 'b'} self.assertEqual(Protocol.connect_command(opts), 'CONNECT {"user": "******", "pass": "******"}\r\n')