Skip to content

Commit cdddbfd

Browse files
committed
Fix mock patches to target correct module paths for CI tests
1 parent b881e92 commit cdddbfd

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

tests/test_input_formats.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ class TestInputFormats:
1313
def run_onecite_process(self, input_content, input_type="txt"):
1414
"""Helper method to run onecite processing with mocked API calls"""
1515
try:
16-
# Mock requests.get to avoid real API calls
17-
with patch('requests.get', side_effect=mock_requests_get):
16+
# Mock requests.get in all modules to avoid real API calls
17+
with patch('onecite.pipeline.requests.get', side_effect=mock_requests_get), \
18+
patch('onecite.core.requests.get', side_effect=mock_requests_get), \
19+
patch('requests.get', side_effect=mock_requests_get):
1820
from onecite import process_references
1921

2022
def mock_callback(candidates):

tests/test_integration.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ class TestIntegration:
1414
def run_onecite_process(self, input_content, input_type="txt", output_format="bibtex", template="journal_article_full"):
1515
"""Helper method to run onecite processing with mocked API calls"""
1616
try:
17-
# Mock requests.get to avoid real API calls
18-
with patch('requests.get', side_effect=mock_requests_get):
17+
# Mock requests.get in all modules to avoid real API calls
18+
with patch('onecite.pipeline.requests.get', side_effect=mock_requests_get), \
19+
patch('onecite.core.requests.get', side_effect=mock_requests_get), \
20+
patch('requests.get', side_effect=mock_requests_get):
1921
from onecite import process_references
2022

2123
def mock_callback(candidates):

tests/test_templates.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ class TestTemplates:
1414
def run_onecite_process(self, input_content, input_type="txt", template="journal_article_full"):
1515
"""Helper method to run onecite processing with mocked API calls"""
1616
try:
17-
# Mock requests.get to avoid real API calls
18-
with patch('requests.get', side_effect=mock_requests_get):
17+
# Mock requests.get in all modules to avoid real API calls
18+
with patch('onecite.pipeline.requests.get', side_effect=mock_requests_get), \
19+
patch('onecite.core.requests.get', side_effect=mock_requests_get), \
20+
patch('requests.get', side_effect=mock_requests_get):
1921
from onecite import process_references
2022

2123
def mock_callback(candidates):

0 commit comments

Comments
 (0)