From 43a67390d019af2440066e67f8ed640041028bc0 Mon Sep 17 00:00:00 2001 From: Kory Draughn Date: Wed, 27 Mar 2024 18:41:03 -0400 Subject: [PATCH] squash. testing --- lib/api/src/rc_genquery2.cpp | 2 +- .../test/test_genquery2_microservices.py | 26 +++++++++---------- unit_tests/src/test_rc_genquery2.cpp | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/api/src/rc_genquery2.cpp b/lib/api/src/rc_genquery2.cpp index 4cf0f23655..bb00f93753 100644 --- a/lib/api/src/rc_genquery2.cpp +++ b/lib/api/src/rc_genquery2.cpp @@ -6,7 +6,7 @@ auto rc_genquery2(RcComm* _comm, GenQuery2Input* _input, char** _output) -> int { - if (!_input || !_output) { + if (!_comm || !_input || !_output) { return SYS_INVALID_INPUT_PARAM; } diff --git a/scripts/irods/test/test_genquery2_microservices.py b/scripts/irods/test/test_genquery2_microservices.py index 83c2d7bb40..a122b1e1d5 100644 --- a/scripts/irods/test/test_genquery2_microservices.py +++ b/scripts/irods/test/test_genquery2_microservices.py @@ -28,23 +28,23 @@ def test_microservices_can_be_used_in_the_native_rule_engine_plugin__issue_7570( rule_file = f'{self.user.local_session_dir}/genquery2_issue_7570.nrep.r' with open(rule_file, 'w') as f: - f.write(textwrap.dedent(''' - test_issue_7570_nrep { + f.write(textwrap.dedent(f''' + test_issue_7570_nrep {{ msi_genquery2_execute(*handle, "select COLL_NAME where COLL_NAME = '{self.user.session_collection}'"); - while (errorcode(msi_genquery2_next_row(*handle)) == 0) { - msi_genquery2_column(*handle, '0', *coll_pname); + while (errorcode(msi_genquery2_next_row(*handle)) == 0) {{ + msi_genquery2_column(*handle, '0', *coll_name); writeLine('stdout', '*coll_name'); - } + }} msi_genquery2_free(*handle); - } + }} - INPUT *handle=%*coll_name= - OUTPUT *ruleExecOut + INPUT *handle="", *coll_name="" + OUTPUT ruleExecOut ''')) - rep_name = plugin_name + '-instance' + rep_name = self.plugin_name + '-instance' self.user.assert_icommand(['irule', '-r', rep_name, '-F', rule_file], 'STDOUT', [self.user.session_collection]) @unittest.skipUnless(plugin_name == 'irods_rule_engine_plugin-python', 'Designed for the PREP') @@ -52,8 +52,8 @@ def test_microservices_can_be_used_in_the_python_rule_engine_plugin(self): rule_file = f'{self.user.local_session_dir}/genquery2_issue_7570.prep.r' with open(rule_file, 'w') as f: - f.write(textwrap.dedent(''' - test_issue_7570_prep(rule_args, callback, rei) { + f.write(textwrap.dedent(f''' + test_issue_7570_prep(rule_args, callback, rei) {{ result = callback.msi_genquery2_execute('', "select COLL_NAME where COLL_NAME = '{self.user.session_collection}'"); handle = result['arguments'][0] @@ -69,11 +69,11 @@ def test_microservices_can_be_used_in_the_python_rule_engine_plugin(self): callback.writeLine('stdout', coll_name); callback.msi_genquery2_free(handle); - } + }} INPUT *handle=%*coll_name= OUTPUT *ruleExecOut ''')) - rep_name = plugin_name + '-instance' + rep_name = self.plugin_name + '-instance' self.user.assert_icommand(['irule', '-r', rep_name, '-F', rule_file], 'STDOUT', [self.user.session_collection]) diff --git a/unit_tests/src/test_rc_genquery2.cpp b/unit_tests/src/test_rc_genquery2.cpp index fb2e9e6ccc..559c71c839 100644 --- a/unit_tests/src/test_rc_genquery2.cpp +++ b/unit_tests/src/test_rc_genquery2.cpp @@ -16,7 +16,7 @@ TEST_CASE("rc_genquery2") { SECTION("execute a simple query") { - //load_client_api_plugins(); + load_client_api_plugins(); rodsEnv env; _getRodsEnv(env);