Skip to content

Commit

Permalink
squash. fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
korydraughn committed Jul 20, 2024
1 parent 044c0e4 commit 90e5f38
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/irods/test/test_prep_genquery_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -958,17 +958,21 @@ def main(rule_args, callback, rei):
self.admin.assert_icommand(['irule', '-r', rep_instance, '-F', rule_file], 'STDOUT', ['count: 2'])

@unittest.skipUnless(plugin_name == 'irods_rule_engine_plugin-python', 'Requires PREP.')
def test_genquery_iterator_supports_reusing_genquery2_query_object__issue_7909(self):
def test_genquery_iterator_supports_copying_genquery2_query_object__issue_7909(self):
rule_file = f'{self.admin.local_session_dir}/test_genquery_iterator_supports_reusing_genquery2_query_object__issue_7909.r'

with open(rule_file, 'w') as rf:
rf.write(dedent(f'''
def main(rule_args, callback, rei):
from genquery import Query, Parser
query = Query(callback, 'COLL_NAME', "COLL_NAME = '{self.admin.session_collection}'", parser=Parser.GENQUERY2)
for i in range(3):
q1 = Query(callback, 'COLL_NAME', "COLL_NAME = '{self.admin.session_collection}'", parser=Parser.GENQUERY2)
q2 = q1.copy()
q3 = q2.copy()
iterations = 0
for query in [q1, q2, q3]:
for r in query:
callback.writeLine('stdout', f'[iteration={{i}}] row: {{r}}')
callback.writeLine('stdout', f'[iteration={{iterations}}] row: {{r}}')
iterations += 1
INPUT null
OUTPUT ruleExecOut
'''))
Expand Down

0 comments on commit 90e5f38

Please sign in to comment.