def test_text_query(PatchedGCalI): search_parser = get_search_parser() gcal = PatchedGCalI() # TODO: mock the api reply for the search # and then assert something greater than zero opts = search_parser.parse_args(['test', '1970-01-01', '2038-01-18']) assert gcal.TextQuery(opts.text, opts.start, opts.end) == 0 opts = search_parser.parse_args(['test', '1970-01-01']) assert gcal.TextQuery(opts.text, opts.start, opts.end) == 0 opts = search_parser.parse_args(['test']) assert gcal.TextQuery(opts.text, opts.start, opts.end) == 0
def test_modify_event(PatchedGCalI): opts = get_search_parser().parse_args(['test']) gcal = PatchedGCalI(**vars(opts)) assert gcal.ModifyEvents(gcal._edit_event, opts.text, opts.start, opts.end) == 0
def test_search_parser(): search_parser = argparsers.get_search_parser() with pytest.raises(SystemExit): search_parser.parse_args([])
def test_modify_event(PatchedGCalI): opts = get_search_parser().parse_args(['test']) gcal = PatchedGCalI(**vars(opts)) assert gcal.ModifyEvents( gcal._edit_event, opts.text, opts.start, opts.end) == 0