Spaces:
Configuration error
Configuration error
Added mocking for Modal API call during summarization testing.
Browse files- tests/test_gradio.py +6 -2
tests/test_gradio.py
CHANGED
|
@@ -179,8 +179,10 @@ class TestProcessInputs(unittest.TestCase):
|
|
| 179 |
# Mock default job call loading to return content
|
| 180 |
mock_load_default.return_value = "Default job content from sample_job.txt"
|
| 181 |
|
| 182 |
-
with patch('functions.gradio.get_github_repositories') as mock_github
|
|
|
|
| 183 |
mock_github.return_value = {"status": "success", "metadata": {"username": "gperdrizet"}}
|
|
|
|
| 184 |
|
| 185 |
result = gradio.process_inputs(None, " ", " ", " ")
|
| 186 |
|
|
@@ -197,8 +199,10 @@ class TestProcessInputs(unittest.TestCase):
|
|
| 197 |
# Mock default job call loading to return None
|
| 198 |
mock_load_default.return_value = None
|
| 199 |
|
| 200 |
-
with patch('functions.gradio.get_github_repositories') as mock_github
|
|
|
|
| 201 |
mock_github.return_value = {"status": "success", "metadata": {"username": "gperdrizet"}}
|
|
|
|
| 202 |
|
| 203 |
result = gradio.process_inputs(None, " ", " ", " ")
|
| 204 |
|
|
|
|
| 179 |
# Mock default job call loading to return content
|
| 180 |
mock_load_default.return_value = "Default job content from sample_job.txt"
|
| 181 |
|
| 182 |
+
with patch('functions.gradio.get_github_repositories') as mock_github, \
|
| 183 |
+
patch('functions.gradio.summarize_job_call') as mock_summarize:
|
| 184 |
mock_github.return_value = {"status": "success", "metadata": {"username": "gperdrizet"}}
|
| 185 |
+
mock_summarize.return_value = "Mocked job summary"
|
| 186 |
|
| 187 |
result = gradio.process_inputs(None, " ", " ", " ")
|
| 188 |
|
|
|
|
| 199 |
# Mock default job call loading to return None
|
| 200 |
mock_load_default.return_value = None
|
| 201 |
|
| 202 |
+
with patch('functions.gradio.get_github_repositories') as mock_github, \
|
| 203 |
+
patch('functions.gradio.summarize_job_call') as mock_summarize:
|
| 204 |
mock_github.return_value = {"status": "success", "metadata": {"username": "gperdrizet"}}
|
| 205 |
+
mock_summarize.return_value = None # No summarization since no job post
|
| 206 |
|
| 207 |
result = gradio.process_inputs(None, " ", " ", " ")
|
| 208 |
|