MCPcopy Create free account
hub / github.com/DeepL/deepl-python / test_glossary_create_invalid

Function test_glossary_create_invalid

tests/test_multilingual_glossary.py:222–249  ·  view source on GitHub ↗
(
    deepl_client, glossary_name, cleanup_matching_glossaries
)

Source from the content-addressed store, hash-verified

220
221
222def test_glossary_create_invalid(
223 deepl_client, glossary_name, cleanup_matching_glossaries
224):
225 try:
226 with pytest.raises(ValueError):
227 glossary_dict = MultilingualGlossaryDictionaryEntries(
228 "EN", "DE", {"Hello": "Hallo"}
229 )
230 deepl_client.create_multilingual_glossary("", [glossary_dict])
231 with pytest.raises(deepl.DeepLException):
232 glossary_dict = MultilingualGlossaryDictionaryEntries(
233 "EN", "XX", {"Hallo": "Hello"}
234 )
235 deepl_client.create_multilingual_glossary(
236 glossary_name, [glossary_dict]
237 )
238 with pytest.raises(ValueError):
239 glossary_dict = MultilingualGlossaryDictionaryEntries(
240 "EN", "XX", {}
241 )
242 deepl_client.create_multilingual_glossary(
243 glossary_name, [glossary_dict]
244 )
245
246 finally:
247 cleanup_matching_glossaries(
248 lambda glossary: glossary.name == glossary_name
249 )
250
251
252def test_glossary_create_large(deepl_client, multilingual_glossary_manager):

Callers

nothing calls this directly

Tested by

no test coverage detected