Example #1
0
def test_parser_show(args, exp):
    # use dict instead of argparse.Namespace for pretty pytest diff
    exp_ns = {'action': exp[0],
              'session': exp[1],
              'slices': exp[2],
              'numerate': exp[3],
              'reverse': exp[4]}
    ns = _hist_parse_args(shlex.split(args))
    assert ns.__dict__ == exp_ns
Example #2
0
def test_parser_show(args, exp):
    # use dict instead of argparse.Namespace for pretty pytest diff
    exp_ns = {'action': exp[0],
              'session': exp[1],
              'slices': exp[2],
              'numerate': exp[3],
              'reverse': exp[4],
              'start_time': None,
              'end_time': None,
              'datetime_format': None,
              'timestamp': False}
    ns = _hist_parse_args(shlex.split(args))
    assert ns.__dict__ == exp_ns
Example #3
0
def test_parser_show(args, exp):
    # use dict instead of argparse.Namespace for pretty pytest diff
    exp_ns = {
        'action': exp[0],
        'session': exp[1],
        'slices': exp[2],
        'numerate': exp[3],
        'reverse': exp[4],
        'start_time': None,
        'end_time': None,
        'datetime_format': None,
        'timestamp': False
    }
    ns = _hist_parse_args(shlex.split(args))
    assert ns.__dict__ == exp_ns
Example #4
0
def test_parse_args_help(args, capsys):
    with pytest.raises(SystemExit):
        args = _hist_parse_args(shlex.split(args))
    assert 'show this help message and exit' in capsys.readouterr()[0]
Example #5
0
def test_parser_show(args, exp):
    args = _hist_parse_args(shlex.split(args))
    action, session, slices = exp
    assert args.action == action
    assert args.session == session
    assert args.slices == slices
Example #6
0
def test_parse_args_help(args, capsys):
    with pytest.raises(SystemExit):
        args = _hist_parse_args(shlex.split(args))
    assert 'show this help message and exit' in capsys.readouterr()[0]