def test_build_event(self):
        evt = event.build_event("evt_name", arg1="val1", arg2=None)
        assert evt.name == "evt_name"
        assert evt.args == {'arg1': "val1", 'arg2': None}
def image_thumbnail(filename):
    filepath = os.path.join(app.config.get('UPLOAD_FOLDER'), filename)
    im = Image.open(filepath)
    w, h = im.size

    if w > h:
        im.thumbnail((106, 106*h/w))
    else:
        im.thumbnail((106*w/h, 106))

    im.save(os.path.join(app.config.get('UPLOAD_FOLDER'), 
        os.path.splitext(filename)[0] + '_thumbnail' + os.path.splitext(filename)[1]))