import os
import tempfile
import omni.kit.test
import carb.settings
import omni.kit.commands
from omni.rtx.window.settings import RendererSettingsFactory
from omni.kit.test.async_unittest import AsyncTestCase
from omni.kit import ui_test
from omni.kit.test_suite.helpers import open_stage, get_test_data_path, select_prims, wait_stage_loading, arrange_windows


class TestSerialiser(AsyncTestCase):
    # Before running each test
    async def setUp(self):
        await arrange_windows()

    # After running each test
    async def tearDown(self):
        pass

    async def test_serialiser(self):
        from omni.rtx.window.settings.usd_serializer import USDSettingsSerialiser

        with tempfile.TemporaryDirectory() as tempdir:
            file = os.path.join(tempdir, "test.usd")
            serialiser = USDSettingsSerialiser()
            serialiser.save_to_usd(file)
            serialiser.load_from_usd(file)
