@@ -518,13 +518,8 @@ def test_send_parsing_request_success():
518518 with (
519519 patch ("agentic_doc.parse.httpx.post" , return_value = mock_response ),
520520 patch ("agentic_doc.parse.open" , MagicMock ()),
521- patch ("agentic_doc.parse.Path" ) as mock_path ,
521+ patch ("agentic_doc.parse.get_file_type" , return_value = "pdf" ) ,
522522 ):
523- # Setup mock to make the suffix check work
524- mock_path_instance = MagicMock ()
525- mock_path_instance .suffix .lower .return_value = ".pdf"
526- mock_path .return_value = mock_path_instance
527-
528523 # Call the function
529524 result = _send_parsing_request ("test.pdf" )
530525
@@ -2108,12 +2103,8 @@ def test_send_parsing_request_with_figure_captioning_parameters(self):
21082103 with (
21092104 patch ("agentic_doc.parse.httpx.post" , return_value = mock_response ) as mock_post ,
21102105 patch ("agentic_doc.parse.open" , MagicMock ()),
2111- patch ("agentic_doc.parse.Path" ) as mock_path ,
2106+ patch ("agentic_doc.parse.get_file_type" , return_value = "pdf" ) ,
21122107 ):
2113- # Setup mock to make the suffix check work
2114- mock_path_instance = MagicMock ()
2115- mock_path_instance .suffix .lower .return_value = ".pdf"
2116- mock_path .return_value = mock_path_instance
21172108
21182109 # Call with custom figure captioning
21192110 config = ParseConfig (
@@ -2144,12 +2135,8 @@ def test_send_parsing_request_with_default_parameters(self):
21442135 with (
21452136 patch ("agentic_doc.parse.httpx.post" , return_value = mock_response ) as mock_post ,
21462137 patch ("agentic_doc.parse.open" , MagicMock ()),
2147- patch ("agentic_doc.parse.Path" ) as mock_path ,
2138+ patch ("agentic_doc.parse.get_file_type" , return_value = "pdf" ) ,
21482139 ):
2149- # Setup mock to make the suffix check work
2150- mock_path_instance = MagicMock ()
2151- mock_path_instance .suffix .lower .return_value = ".pdf"
2152- mock_path .return_value = mock_path_instance
21532140
21542141 # Call with defaults
21552142 result = _send_parsing_request ("test.pdf" )
0 commit comments