'Test that queueing works properly'

@skip_if_disabled
def test_queue(self):

    self.assertFalse(self.cache.is_cached(1))
    self.assertFalse(self.cache.is_queued(1))
    FIXTURE_FILE = six.BytesIO(FIXTURE_DATA)
    self.assertTrue(self.cache.queue_image(1))
    self.assertTrue(self.cache.is_queued(1))
    self.assertFalse(self.cache.is_cached(1))
    self.assertFalse(self.cache.queue_image(1))
    self.assertFalse(self.cache.is_cached(1))
    self.assertTrue(self.cache.cache_image_file(1, FIXTURE_FILE))
    self.assertFalse(self.cache.is_queued(1))
    self.assertTrue(self.cache.is_cached(1))
    self.assertFalse(self.cache.queue_image(1))
    self.cache.delete_cached_image(1)
    for x in range(3):
        self.assertTrue(self.cache.queue_image(x))
    self.assertEqual(['0', '1', '2'], self.cache.get_queued_images())
