def test_two_commands_first_has_improper_line_ending(self, client_socket): self.logger.info("Trying to send two commands first with improper line eding") req = get_method_template("player-execute", "HomeCommand", lstr("nothing")) client_socket.send(req[:-1]+req) response = client_socket.recv(4096) test_error_response(self.logger, response, "GENERAL_SERVER_FAILURE", "JSON Parse error")
def test_garbage_json(self, client_socket): self.logger.info("Sending wrong json") client_socket.send(b"{\"foo\": \"bar\"}\n") response = client_socket.recv(4096) test_error_response(self.logger, response, "GENERAL_SERVER_FAILURE", "JSON Parse error")
def test_non_json(self, client_socket): self.logger.info("Sending non-json") client_socket.send(b"My tooth, my tooth, I think I lost my tooth\n") response = client_socket.recv(4096) test_error_response(self.logger, response, "GENERAL_SERVER_FAILURE", "JSON Parse error")