File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -273,10 +273,10 @@ def parse_markdown_code(markdown_code: str) -> CodeStringsMarkdown:
273273 """
274274 matches = markdown_pattern .findall (markdown_code )
275275 code_string_list = []
276- for file_path , code in matches :
277- path = file_path .strip ()
278- code_string_list .append (CodeString (code = code , file_path = Path (path )))
279276 try :
277+ for file_path , code in matches :
278+ path = file_path .strip ()
279+ code_string_list .append (CodeString (code = code , file_path = Path (path )))
280280 return CodeStringsMarkdown (code_strings = code_string_list )
281281 except ValidationError :
282282 # if any file is invalid, return an empty CodeStringsMarkdown for the entire context
Original file line number Diff line number Diff line change @@ -69,3 +69,5 @@ def test_generated_candidates_validation():
6969 ]
7070 candidates = ai_service ._get_valid_candidates (mock_generate_candidates , OptimizedCandidateSource .OPTIMIZE )
7171 assert len (candidates ) == 1
72+ assert candidates [0 ].source_code .code_strings [0 ].code == "print('Hello, World!')"
73+ assert candidates [0 ].source_code .code_strings [0 ].file_path .as_posix () == "file.py"
You can’t perform that action at this time.
0 commit comments