Skip to content

Commit

Permalink
add other tests for f-string concat
Browse files Browse the repository at this point in the history
  • Loading branch information
gnufede committed Nov 29, 2024
1 parent 322cd3f commit 855a541
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/appsec/iast/aspects/test_common_aspects_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ def generate_callers_from_callees(functions_module, callees_module, callers_file
callers.write(f"from {callees_module_str} import *\n")
callers.write(f"from {callees_module_str} import _number_generator\n")
callers.write("_ng = _number_generator()\n")
callers.write("_static_number = 42\n")
callers.write("_concat = f' {_static_number}' f'{_static_number}'\n")

for function in module_functions:
callers.write(
f"""
def generator_call_{function}(*args, **kwargs):
return next(_ng).{function}(*args, **kwargs)
return next(_ng).{function}(*args, **kwargs) + _concat
"""
)

Expand Down

0 comments on commit 855a541

Please sign in to comment.