'Test to see if open_for_write works in normal case'

def test_open_for_write_good(self):

    image_id = '1'
    self.assertFalse(self.cache.is_cached(image_id))
    with self.cache.driver.open_for_write(image_id) as cache_file:
        cache_file.write('a')
    self.assertTrue(self.cache.is_cached(image_id), ('Image    %s    was    NOT    cached!' % image_id))
    incomplete_file_path = os.path.join(self.cache_dir, 'incomplete', image_id)
    invalid_file_path = os.path.join(self.cache_dir, 'invalid', image_id)
    self.assertFalse(os.path.exists(incomplete_file_path))
    self.assertFalse(os.path.exists(invalid_file_path))
