def test_relative_nested_maintain(self):
        """Tests nested structure is maintained in export dir. No change in
        relative asset paths in fo3d file.
        """
        with tempfile.TemporaryDirectory() as temp_dir:
            dataset = self._build_nested_relative(temp_dir)

            # Export it - with root data dir as rel_dir
            root_data_dir = os.path.join(temp_dir, "data")
            export_dir = os.path.join(temp_dir, "export")

            dataset.export(
                export_dir=export_dir,
                dataset_type=fo.types.MediaDirectory,
                export_media=True,
                rel_dir=root_data_dir,
            )

            scene1 = fo.Scene.from_fo3d(
                os.path.join(export_dir, "label1", "test", "s.fo3d")
            )
            self.assertEqual(
                scene1.background.image, os.path.join("..", "..", "image.jpeg")
            )

            for file in scene1.get_asset_paths():
                with open(
                    os.path.join(export_dir, "label1", "test", file)
                ) as f:
                    self.assertEqual(f.read(), os.path.basename(file))

            scene2 = fo.Scene.from_fo3d(
                os.path.join(export_dir, "label2", "test", "s.fo3d")
            )
            self.assertEqual(
                scene2.background.image, os.path.join("..", "..", "image.jpeg")
            )

            for file in scene2.get_asset_paths():
                with open(
                    os.path.join(export_dir, "label2", "test", file)
                ) as f:
                    if file.endswith("image.jpeg"):
                        continue
                    self.assertEqual(
                        f.read(),
                        os.path.basename(file) + "2",
                    )
Tests nested structure is maintained in export dir. No change in
        relative asset paths in fo3d file.
        
tests/unittests/import_export_tests.py