## Copyright (c) 2021, NVIDIA CORPORATION.  All rights reserved.
##
## NVIDIA CORPORATION and its licensors retain all intellectual property
## and proprietary rights in and to this software, related documentation
## and any modifications thereto.  Any use, reproduction, disclosure or
## distribution of this software and related documentation without an express
## license agreement from NVIDIA CORPORATION is strictly prohibited.
##
import omni.kit.app
import omni.kit.test
from .test_common import RtxTest, testSettings, postLoadTestSettings, wait_for_update
from pxr import UsdGeom, UsdLux

class TestUsdLuxSchemaCompat(RtxTest):
    TEST_PATH = "hydra/usdlux"

    async def test_usdlux_inputs_prefix(self):
        """
        Test that the compatibility workaround for UsdLux schema changes that requires an inputs: prefix on attributes works.
        """
        test_file_path = "hydra/simpleSphereLightUnprefixed.usda"
        super().open_usd(test_file_path)
        await wait_for_update()
        await self.capture_and_compare(self.TEST_PATH, "lightAttributes.png")

    async def test_usdlux_light_with_both_attributes(self):
        """
        Test that the delegate chooses inputs: attributes when both inputs and non-inputs are authored.
        The usda for this test has these properties defined:
            float inputs:intensity = 30000
            float intensity = 90000000
        """
        test_file_path = "hydra/simpleSphereLightBothAttributes.usda"
        super().open_usd(test_file_path)
        await wait_for_update()
        await self.capture_and_compare(self.TEST_PATH, "lightAttributes.png")