Skip to content

Commit

Permalink
squash. testing
Browse files Browse the repository at this point in the history
  • Loading branch information
korydraughn committed Mar 27, 2024
1 parent 9c65012 commit 43a6739
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/api/src/rc_genquery2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
26 changes: 13 additions & 13 deletions scripts/irods/test/test_genquery2_microservices.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,32 @@ 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')
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]
Expand All @@ -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])
2 changes: 1 addition & 1 deletion unit_tests/src/test_rc_genquery2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 43a6739

Please sign in to comment.