From a8bd37be4a8304934257173a621b9d5eba89fff4 Mon Sep 17 00:00:00 2001 From: Darren Lester Date: Fri, 13 Sep 2024 20:42:22 +0100 Subject: [PATCH] Change to test workflow --- app/backend_gcf/tests/test_main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/backend_gcf/tests/test_main.py b/app/backend_gcf/tests/test_main.py index c2efdf7..7b869ec 100644 --- a/app/backend_gcf/tests/test_main.py +++ b/app/backend_gcf/tests/test_main.py @@ -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 @@ -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"})