Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
fred-labs committed Sep 11, 2024
1 parent a63609d commit 9e9d1cf
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/scenario_execution_test/test/test_external_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,25 @@ def test_dict(val: test_struct) -> int is external scenario_execution_test.exter
with open(self.tmp_file.name) as f:
result = f.read()
self.assertEqual(result, "{'mem1': 1, 'mem2': 'bar'}")

def test_success_list_with_method_output(self):
scenario_content = """
struct test_struct:
mem1: int = 3
mem2: string = "bar"
struct lib:
def test_dict(val: test_struct) -> int is external scenario_execution_test.external_methods.external_methods.test_dict()
action store_action:
file_path: string
value: list of string
scenario test:
do store_action('""" + self.tmp_file.name + """', ['test', lib.test_dict(test_struct(mem1: 1, mem2: "bar")), 'prefix' + lib.test_dict(test_struct(mem1: 2, mem2: "foo"))])
"""
self.execute(scenario_content)
self.assertTrue(self.scenario_execution.process_results())
with open(self.tmp_file.name) as f:
result = f.read()
self.assertEqual(result, "['test', \"{'mem1': 1, 'mem2': 'bar'}\", \"prefix{'mem1': 2, 'mem2': 'foo'}\"]")

0 comments on commit 9e9d1cf

Please sign in to comment.