def test_can_get_detector_data(self): key = '/some/path/to/file.jpg' storage = Storage(self.context) self.memcached.set(storage.detector_key_for(key), dumps('test-detector-data')) data = storage.get_detector_data(key).result() expect(data).to_equal('test-detector-data')
def test_can_put_detector_data(self): storage = Storage(self.context) key = '/some/path/to/file.jpg' storage.put_detector_data(key, 'detector-test-data') data = self.memcached.get(storage.detector_key_for(key)) expect(loads(data)).to_equal('detector-test-data')
def test_can_get_detector_key_for_url(self): storage = Storage(self.context) key = 'thumbor-detector-http://www.globo.com/' expected = hashlib.sha1(key).hexdigest() expect(storage.detector_key_for('http://www.globo.com/')).to_equal(expected)
def test_can_get_detector_key_for_url(self): storage = Storage(self.context) key = 'thumbor-detector-http://www.globo.com/' expected = hashlib.sha1(key).hexdigest() expect(storage.detector_key_for('http://www.globo.com/')).to_equal( expected)