Skip to content

Commit

Permalink
Change to test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
derailed-dash committed Sep 13, 2024
1 parent e6b58b2 commit a8bd37b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/backend_gcf/tests/test_main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import unittest
import io
from unittest.mock import MagicMock
from ..main import extract_and_translate, detect_text, translate_text
from google.cloud import vision
Expand Down Expand Up @@ -32,7 +31,7 @@ class TestImageTextTranslator(unittest.TestCase):
# self.assertEqual(response, expected_translated_text["text"])

def test_detect_text_with_text(self):
# Mock the response from the Vision API
""" Mock the response from the Vision API """
test_text = "Sample text"
vision.ImageAnnotatorClient.text_detection = MagicMock(return_value=MagicMock(text_annotations=[MagicMock(description=test_text)]))
translate.Client.detect_language = MagicMock(return_value={"language": "en"})
Expand Down

0 comments on commit a8bd37b

Please sign in to comment.