def test(self): data = "aGVsbG8gdGhlcmUgaGVsbG8gaGUgc2VzaCBhb3VlIHN0aGFzb2VzdCAnLixwdGVvb28n" text = base64.b64decode(data) expression = utils.preprocess_expression("'{print $2}'") processed_lines = utils.process_lines(self.logger, text, expression).decode("utf-8") return {Output.OUT: processed_lines == "there\n"}
def test(self): text = "hello world" expression = utils.preprocess_expression("'{print $2}'") processed_lines = utils.process_lines(self.logger, text, expression).decode("utf-8") return {Output.OUT: processed_lines == "world\n"}
def run(self, params={}): expression = utils.preprocess_expression(params.get(Input.EXPRESSION)) out = utils.process_lines(self.logger, params.get(Input.TEXT), expression) return {Output.OUT: out.decode("utf-8")}
def run(self, params={}): expression = utils.preprocess_expression(self.logger, params.get('expression')) out = utils.process_lines(self.logger, params.get('text'), expression) return {'out': out.decode('utf-8')}
def run(self, params={}): text = base64.b64decode(params.get(Input.DATA)) expression = utils.preprocess_expression(params.get(Input.EXPRESSION)) out = utils.process_lines(self.logger, text, expression) return {Output.OUT: out.decode("utf-8")}
def run(self, params={}): text = base64.b64decode(params['data']) expression = utils.preprocess_expression(self.logger, params.get('expression')) out = utils.process_lines(self.logger, text, expression) return {'out': out.decode('utf-8')}