def __init__(self, app, global_conf, resolutions=DEFAULT_RESOLUTIONS): self.app = app self.global_conf = global_conf self.acceptable_types = [ 'image/jpeg', 'image/png', 'image/gif'] try: self.resolutions = to_int_list(resolutions) except: raise ValueError('resolutions must be a comma-separated' 'list of integers') pass
def test_to_int_list(self): # we can turn strings into lists of integers self.assertEqual(to_int_list('1, 2, 3'), [1, 2, 3]) self.assertEqual(to_int_list('123'), [123]) return