コード例 #1
0
def test__parse_args_clip_dir_success():
    sys.argv = ['clip9.py', 'result.mp4', 'cloud9', '--clips_dir', './clips']
    args = clip9._parse_args()
    assert args.output_file == 'result.mp4'
    assert args.team == 'cloud9'
    assert args.started_at is None
    assert args.ended_at is None
    assert args.clips_dir == './clips'
    assert args.lang is None
    assert args.log_file is None
コード例 #2
0
def test__parse_args_lang_short_success():
    sys.argv = ['clip9.py', 'result.mp4', 'cloud9', '-l', 'en']
    args = clip9._parse_args()
    assert args.output_file == 'result.mp4'
    assert args.team == 'cloud9'
    assert args.started_at is None
    assert args.ended_at is None
    assert args.clips_dir == './'
    assert args.lang == 'en'
    assert args.log_file is None
コード例 #3
0
def test__parse_args_team_output_file_no_start_time_success():
    sys.argv = ['clip9.py', 'result.mp4', 'cloud9']
    args = clip9._parse_args()
    assert args.output_file == 'result.mp4'
    assert args.team == 'cloud9'
    assert args.started_at is None
    assert args.ended_at is None
    assert args.clips_dir == './'
    assert args.lang is None
    assert args.log_file is None
コード例 #4
0
def test__parse_args_ended_at_short_success():
    sys.argv = [
        'clip9.py', 'result.mp4', 'cloud9', '-e', '2008-09-08T22:47:31Z'
    ]
    args = clip9._parse_args()
    assert args.output_file == 'result.mp4'
    assert args.team == 'cloud9'
    assert args.started_at is None
    assert args.ended_at == '2008-09-08T22:47:31Z'
    assert args.clips_dir == './'
    assert args.lang is None
    assert args.log_file is None
コード例 #5
0
def test__parse_args_extra_arg_exit():
    sys.argv = ['clip9.py', 'result.mp4', 'cloud9', 'a']
    with pytest.raises(SystemExit):
        clip9._parse_args()
コード例 #6
0
def test__parse_args_no_team_exit():
    sys.argv = ['clip9.py', 'result.mp4']
    with pytest.raises(SystemExit):
        clip9._parse_args()