Skip to content

Commit f72db69

Browse files
committed
Improve CLI tests to actually test the CLI functionality
1 parent 245160c commit f72db69

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tests/test_face_recognition.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,20 @@ def test_compare_faces_empty_lists(self):
182182
self.assertEqual(type(match_results), list)
183183
self.assertListEqual(match_results, [])
184184

185-
def test_command_line_interface(self):
186-
target_string = '--help Show this message and exit.'
185+
def test_command_line_interface_options(self):
186+
target_string = '--help Show this message and exit.'
187187
runner = CliRunner()
188188
help_result = runner.invoke(cli.main, ['--help'])
189189
self.assertEqual(help_result.exit_code, 0)
190190
self.assertTrue(target_string in help_result.output)
191+
192+
def test_command_line_interface(self):
193+
target_string = 'obama.jpg,obama'
194+
runner = CliRunner()
195+
image_folder = os.path.join(os.path.dirname(__file__), 'test_images')
196+
image_file = os.path.join(os.path.dirname(__file__), 'test_images', 'obama.jpg')
197+
198+
help_result = runner.invoke(cli.main, args=[image_folder, image_file])
199+
200+
self.assertEqual(help_result.exit_code, 0)
201+
self.assertTrue(target_string in help_result.output)

0 commit comments

Comments
 (0)