def test_cal_query(capsys, PatchedGCalI): opts = vars(get_cal_query_parser().parse_args([])) opts.update(vars(get_output_parser().parse_args([]))) opts.update(vars(get_color_parser().parse_args([]))) gcal = PatchedGCalI(**opts) gcal.CalQuery('calw') captured = capsys.readouterr() art = gcal.printer.art expect_top = (gcal.printer.colors[gcal.options['color_border']] + art['ulc'] + art['hrz'] * gcal.options['cal_width']) assert captured.out.startswith(expect_top) gcal.CalQuery('calm') captured = capsys.readouterr() assert captured.out.startswith(expect_top)
def test_cal_query(capsys, PatchedGCalI): opts = vars(get_cal_query_parser().parse_args([])) opts.update(vars(get_output_parser().parse_args([]))) opts.update(vars(get_color_parser().parse_args([]))) gcal = PatchedGCalI(**opts) gcal.CalQuery('calw') captured = capsys.readouterr() art = gcal.printer.art expect_top = ( gcal.printer.colors[gcal.options['color_border']] + art['ulc'] + art['hrz'] * gcal.options['cal_width']) assert captured.out.startswith(expect_top) gcal.CalQuery('calm') captured = capsys.readouterr() assert captured.out.startswith(expect_top)
def default_options(): opts = vars(get_color_parser().parse_args([])) opts.update(vars(get_cal_query_parser().parse_args([]))) opts.update(vars(get_output_parser().parse_args([]))) return opts
def default_options(): opts = vars(get_color_parser().parse_args([])) opts.update(vars(get_cal_query_parser().parse_args([]))) opts.update(vars(get_output_parser().parse_args([]))) return opts