From fdaccfe1e1e988245aae216fa90098e21cc8fb16 Mon Sep 17 00:00:00 2001 From: Eric Joanis Date: Mon, 22 Nov 2021 09:58:52 -0500 Subject: [PATCH] test: increase test coverage for dev.cli --- test/test_prepare_cli.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/test_prepare_cli.py b/test/test_prepare_cli.py index d33f2f55..2ea50c78 100755 --- a/test/test_prepare_cli.py +++ b/test/test_prepare_cli.py @@ -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")