Exemplo n.º 1
0
 def test_validation_positive(self):
     json = [
         {
             'time': '18:00',
             'date': 'yesterday',
             'summary': 'How clone git repository?'
         }
     ]
     validation.validate(json)
Exemplo n.º 2
0
 def test_validation_negative(self):
     json = [
         {
             'foo_time': '18:00',
             'foo_date': 'yesterday',
             'foo_summary': 'How clone git repository?'
         }
     ]
     with testtools.ExpectedException(exc.ValidationError):
         validation.validate(json)
Exemplo n.º 3
0
def main():
    argument = parsing_args()
    config = open_file(argument)
    validation.validate(config)
    del sys.argv[-1]
    google = base.Base()

    google.get_event_list()
    add_links(google, config)
    for event in config:
        google.create_event(event)
Exemplo n.º 4
0
def main():
    argument = parsing_args()
    request = open_file(argument)
    validation.validate(request)
    del sys.argv[-1]
    setup_common()

    google = base.Base()

    remind_method = cfg.CONF.remind_method
    to = cfg.CONF.account
    if remind_method == 'mail':
        for event in request:
            google.send_mail(event, to)
    elif remind_method == 'calendar':
        for event in request:
            google.create_event(event)
    elif not remind_method:
        for event in request:
            google.create_event(event)
            google.send_mail(event, to)