import omni.kit.test
import omni.mtlx
import os
import carb

class SetupTest(omni.kit.test.AsyncTestCase):
    def test_verify_mtlx_search_path(self):
        path:str = omni.mtlx.get_mtlx_stdlib_search_path()
        
        # check the library folder that contains all mtlx standard library modules
        exists = os.path.isdir(path)
        if not exists:
            carb.log_info(f"MaterialX Standard Library Search Path is not existing: {path}")
        self.assertTrue(exists)
        carb.log_info(f"MaterialX Standard Library Search Path found: {path}")
        
        # test some important libraries as secondary check
        self.assertTrue(os.path.exists(os.path.join(path, "bxdf", "standard_surface.mtlx")))
        self.assertTrue(os.path.exists(os.path.join(path, "pbrlib", "genmdl", "pbrlib_genmdl_impl.mtlx")))
