def test_save_and_restore(self):
        engine = self.e
        scene = self.scene

        # Save visualization.
        f = BytesIO()
        f.name = abspath('test.mv2') # We simulate a file.
        engine.save_visualization(f)
        f.seek(0) # So we can read this saved data.

        # Remove existing scene.

        engine.close_scene(scene)

        # Load visualization
        engine.load_visualization(f)
        self.scene = engine.current_scene
        coll = self.scene.children[0].children[0]

        self.check(coll)
Test if saving a visualization and restoring it works.
dataset/ETHPy150Open enthought/mayavi/mayavi/tests/test_optional_collection.py/TestOptionalCollection.test_save_and_restore