Exemple #1
0
def test_image_handler_cli(capsys, img_file):
    test_image_handler = ImageHandler()

    test_args = ["--input={}".format(img_file)]
    test_image_handler.handle_cli(test_args, predict)
    out, err = capsys.readouterr()
    assert out.strip().endswith("(10, 10, 3)")
def test_image_handler_cli_list(capsys, img_files):
    test_image_handler = ImageHandler()

    test_args = ["--input"] + glob.glob(img_files)
    test_image_handler.handle_cli(test_args, predict)
    out, err = capsys.readouterr()
    lines = out.strip().split('\n')
    for line in lines[-10:]:
        assert line.strip().endswith("(10, 10, 3)")