Skip to content

Commit

Permalink
Add basic test case for preserve_formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-jones-dev committed Feb 16, 2022
1 parent 69668fd commit 1328ee8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_translate_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 184,17 @@ def test_formality(translator):
)


def test_preserve_formatting(translator):
# Note: this test may use the mock server that will not translate the text,
# therefore we do not check the translated result.
_ = translator.translate_text(
example_text["EN"], target_lang="DE", preserve_formatting=True
)
_ = translator.translate_text(
example_text["EN"], target_lang="DE", preserve_formatting=False
)


def test_split_sentences_basic(translator):
text = """If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea."""
Expand Down

0 comments on commit 1328ee8

Please sign in to comment.