4
4
from daras_ai_v2 import settings
5
5
from daras_ai_v2 .crypto import get_random_doc_id
6
6
from glossary_resources .models import GlossaryResource
7
- from tests .test_translation import google_translate_check
8
7
9
8
GLOSSARY = [
10
9
{
35
34
},
36
35
]
37
36
38
- TRANSLATION_TESTS_GLOSSARY = [
39
- (
40
- "एक एकड़ भूमि के लिए कितनी अग्निअस्त्र की आवश्यकता होती है" , # source
41
- "how many fire extinguishers are required for one acre of land" , # default translation
42
- "how many agniastra are required for one acre of land" , # using glossary
43
- ),
44
- (
45
- "गुई डॉट ए आई से हम क्या कर सकते हैं" ,
46
- "What can we do with Gui.AI" ,
47
- "What can we do with Gooey.AI" ,
48
- ),
49
- (
50
- "गुई ए आई से हम क्या कर सकते हैं" ,
51
- "What can we do with AI" ,
52
- "What can we do with Gooey.AI" ,
53
- ),
54
- (
55
- "मेरे मिर्ची पर लाल धब्बे आ गये हैं" ,
56
- "My chillies have got red spots" ,
57
- "My Jalapeño have got red spots" ,
58
- ),
59
- ]
60
-
61
37
62
38
@pytest .fixture
63
39
def glossary_url ():
@@ -72,19 +48,3 @@ def glossary_url():
72
48
finally :
73
49
blob .delete ()
74
50
GlossaryResource .objects .all ().delete ()
75
-
76
-
77
- @pytest .mark .skipif (not settings .GS_BUCKET_NAME , reason = "No GCS bucket" )
78
- def test_google_translate_glossary (transactional_db , glossary_url , threadpool_subtest ):
79
- for text , expected , expected_with_glossary in TRANSLATION_TESTS_GLOSSARY :
80
- threadpool_subtest (
81
- google_translate_check ,
82
- text ,
83
- expected ,
84
- )
85
- threadpool_subtest (
86
- google_translate_check ,
87
- text ,
88
- expected_with_glossary ,
89
- glossary_url = glossary_url ,
90
- )
0 commit comments