Skip to content

Commit

Permalink
test: increase test coverage for dev.cli
Browse files Browse the repository at this point in the history
  • Loading branch information
joanise committed Nov 22, 2021
1 parent ca2394f commit fdaccfe
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/test_prepare_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,18 @@ def test_prepare_with_different_newlines(self):
"Using old Mac-style newlines should not affect prepare",
)

def test_create_input_tei_no_input(self):
"""create_input_tei should raise a RuntimeError when given no input"""
def test_create_input_tei_errors(self):
"""create_input_tei should raise a RuntimeError when parameters are missing."""
with self.assertRaises(RuntimeError):
# missing input_file_name or input_file_handle
_, _ = create_input_tei()

with self.assertRaises(RuntimeError):
# missing text_languages
_, _ = create_input_tei(
input_file_name=os.path.join(self.data_dir, "fra.txt")
)

def test_prepare_multiple_langs(self):
"""Giving multiple langs to -l replaces the old --g2p-fallback option."""
input_file = os.path.join(self.data_dir, "fra.txt")
Expand Down

0 comments on commit fdaccfe

Please sign in to comment.