def test_a_new(self): slog.start_log() get_thumbnail(self.im, '50x50') log = slog.stop_log() actions = [ # first see if the file exists 'exists: test/cache/cc/33/cc33e9e8b2355e7e2a9437319c046ad4.jpg', # open the original for thumbnailing 'open: org.jpg', # save the file 'save: test/cache/cc/33/cc33e9e8b2355e7e2a9437319c046ad4.jpg', # check for filename 'get_available_name: test/cache/cc/33/cc33e9e8b2355e7e2a9437319c046ad4.jpg', # called by get_available_name 'exists: test/cache/cc/33/cc33e9e8b2355e7e2a9437319c046ad4.jpg', # save the 1.5 resolution version 'save: test/cache/cc/33/[email protected]', 'get_available_name: test/cache/cc/33/[email protected]', 'exists: test/cache/cc/33/[email protected]', # save the 2 resolution version 'save: test/cache/cc/33/[email protected]', 'get_available_name: test/cache/cc/33/[email protected]', 'exists: test/cache/cc/33/[email protected]' ] self.assertEqual(log, actions)
def test_a_new(self): slog.start_log() get_thumbnail(self.im, '50x50') log = slog.stop_log() actions = [ # first see if the file exists 'exists: test/cache/ff/3d/ff3d0f5fa6e8da5924298ce7354a9d02.jpg', # open the original for thumbnailing 'open: org.jpg', # save the file 'save: test/cache/ff/3d/ff3d0f5fa6e8da5924298ce7354a9d02.jpg', # check for filename 'get_available_name: test/cache/ff/3d/ff3d0f5fa6e8da5924298ce7354a9d02.jpg', # called by get_available_name 'exists: test/cache/ff/3d/ff3d0f5fa6e8da5924298ce7354a9d02.jpg', # save the 1.5 resolution version 'save: test/cache/ff/3d/[email protected]', 'get_available_name: test/cache/ff/3d/[email protected]', 'exists: test/cache/ff/3d/[email protected]', # save the 2 resolution version 'save: test/cache/ff/3d/[email protected]', 'get_available_name: test/cache/ff/3d/[email protected]', 'exists: test/cache/ff/3d/[email protected]' ] self.assertEqual(log, actions)
def test_a_new(self): slog.start_log() get_thumbnail(self.im, '50x50') log = slog.stop_log() actions = [ 'open: org.jpg', # open the original for thumbnailing 'save: test/cache/d0/cb/d0cbb1255c87524a0d66ffed9851ded9.jpg', # save the file 'get_available_name: test/cache/d0/cb/d0cbb1255c87524a0d66ffed9851ded9.jpg', # check for filename 'exists: test/cache/d0/cb/d0cbb1255c87524a0d66ffed9851ded9.jpg', # called by get_available_name ] self.assertEqual(log, actions)
def test_a_new(self): slog.start_log() get_thumbnail(self.im, '50x50') log = slog.stop_log() actions = [ 'exists: test/cache/20/c7/20c7ceda51cd4d26f8f4f375cf9dddf3.jpg', # first see if the file exists 'open: org.jpg', # open the original for thumbnailing 'save: test/cache/20/c7/20c7ceda51cd4d26f8f4f375cf9dddf3.jpg', # save the file 'get_available_name: test/cache/20/c7/20c7ceda51cd4d26f8f4f375cf9dddf3.jpg', # cehck for filename 'exists: test/cache/20/c7/20c7ceda51cd4d26f8f4f375cf9dddf3.jpg', # called by get_available_name ] self.assertEqual(log, actions)
def test_a_new(self): slog.start_log() get_thumbnail(self.im, "50x50") log = slog.stop_log() actions = [ "open: org.jpg", # open the original for thumbnailing # save the file "save: test/cache/ca/1a/ca1afb02b7250c125d8830c0e8a492ad.jpg", # check for filename "get_available_name: test/cache/ca/1a/ca1afb02b7250c125d8830c0e8a492ad.jpg", # called by get_available_name "exists: test/cache/ca/1a/ca1afb02b7250c125d8830c0e8a492ad.jpg", ] self.assertEqual(log, actions)
def test_c_safe_methods(self): slog.start_log() im = default.kvstore.get(self.im) im.url, im.x, im.y log = slog.stop_log() self.assertEqual(log, [])
def test_b_cached(self): slog.start_log() get_thumbnail(self.im, "50x50") log = slog.stop_log() self.assertEqual(log, []) # now this should all be in cache
def test_b_cached(self): slog.start_log() get_thumbnail(self.im, '50x50') log = slog.stop_log() self.assertEqual(log, []) # now this should all be in cache