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

Function test_glossary_create_invalid

tests/test_glossary.py:65–81  ·  view source on GitHub ↗
(
    translator, glossary_name, cleanup_matching_glossaries
)

Source from the content-addressed store, hash-verified

63
64
65def test_glossary_create_invalid(
66 translator, glossary_name, cleanup_matching_glossaries
67):
68 try:
69 with pytest.raises(ValueError):
70 translator.create_glossary("", "EN", "DE", {"Hello": "Hallo"})
71 with pytest.raises(deepl.DeepLException):
72 translator.create_glossary(
73 glossary_name, "EN", "XX", {"Hello": "Hallo"}
74 )
75 with pytest.raises(ValueError):
76 translator.create_glossary(glossary_name, "EN", "DE", {})
77
78 finally:
79 cleanup_matching_glossaries(
80 lambda glossary: glossary.name == glossary_name
81 )
82
83
84def test_glossary_create_large(translator, glossary_manager):

Callers

nothing calls this directly

Calls 2

create_glossaryMethod · 0.80

Tested by

no test coverage detected