Skip to content

Commit f1dc490

Browse files
committed
Update test_code_utils.py
1 parent 018581f commit f1dc490

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/test_code_utils.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
is_class_defined_in_file,
1818
module_name_from_file_path,
1919
path_belongs_to_site_packages,
20+
has_any_async_functions,
2021
)
2122
from codeflash.code_utils.concolic_utils import clean_concolic_tests
2223
from codeflash.code_utils.coverage_utils import generate_candidates, prepare_coverage_files
@@ -441,3 +442,27 @@ def test_Grammar_copy():
441442
Grammar.copy(Grammar())
442443
"""
443444
assert cleaned_code == expected_cleaned_code.strip()
445+
446+
447+
def test_has_any_async_functions_with_async_code() -> None:
448+
code = """
449+
def normal_function():
450+
pass
451+
452+
async def async_function():
453+
pass
454+
"""
455+
result = has_any_async_functions(code)
456+
assert result is True
457+
458+
459+
def test_has_any_async_functions_without_async_code() -> None:
460+
code = """
461+
def normal_function():
462+
pass
463+
464+
def another_function():
465+
pass
466+
"""
467+
result = has_any_async_functions(code)
468+
assert result is False

0 commit comments

Comments
 (0)