Skip to content

Commit 9f11194

Browse files
committed
tests: adding some tests about spcific cases
1 parent a9d31dd commit 9f11194

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

β€Žtests/test_major_functionality.pyβ€Ž

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,24 @@ def test_disabled_rule_in_config():
265265
matches = tool.check(text)
266266
assert len(matches) == 0
267267

268+
def test_special_char_in_text():
269+
import language_tool_python
270+
tool = language_tool_python.LanguageTool('en-US')
271+
text = "The sun was seting πŸŒ…, casting a warm glow over the park. Birds chirpped softly 🐦 as the day slowly fade into night."
272+
assert tool.correct(text) == "The sun was setting πŸŒ…, casting a warm glow over the park. Birds chipped softly 🐦 as the day slowly fade into night."
273+
tool.close()
274+
275+
def test_install_inexistent_version():
276+
import language_tool_python
277+
with pytest.raises(LanguageToolError):
278+
language_tool_python.LanguageTool(language_tool_download_version="0.0.0")
279+
280+
def test_inexistant_language():
281+
import language_tool_python
282+
with language_tool_python.LanguageTool("en-US") as tool:
283+
with pytest.raises(ValueError):
284+
language_tool_python.LanguageTag("xx-XX", tool._get_languages())
285+
268286

269287
def test_debug_mode():
270288
from language_tool_python.server import DEBUG_MODE

0 commit comments

Comments
Β (0)