提交 f72db69d 编写于 作者: A Adam Geitgey

Improve CLI tests to actually test the CLI functionality

上级 245160c2
......@@ -182,9 +182,20 @@ class Test_face_recognition(unittest.TestCase):
self.assertEqual(type(match_results), list)
self.assertListEqual(match_results, [])
def test_command_line_interface(self):
target_string = '--help Show this message and exit.'
def test_command_line_interface_options(self):
target_string = '--help Show this message and exit.'
runner = CliRunner()
help_result = runner.invoke(cli.main, ['--help'])
self.assertEqual(help_result.exit_code, 0)
self.assertTrue(target_string in help_result.output)
def test_command_line_interface(self):
target_string = 'obama.jpg,obama'
runner = CliRunner()
image_folder = os.path.join(os.path.dirname(__file__), 'test_images')
image_file = os.path.join(os.path.dirname(__file__), 'test_images', 'obama.jpg')
help_result = runner.invoke(cli.main, args=[image_folder, image_file])
self.assertEqual(help_result.exit_code, 0)
self.assertTrue(target_string in help_result.output)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册