Exemplo n.º 1
0
    def test_token_resolution_with_installed_configuration(self):
        """
        Tests an installed configuration's resolving of the CONFIG_FOLDER and PIPELINE_CONFIG
        """
        self.setup_fixtures(parameters={"installed_config": True})

        # For path and the platform specific path token...
        for path_key in ["path", ShotgunPath.get_shotgun_storage_key()]:
            # For both path based descriptors..
            for desc_type in ["path", "dev"]:
                # For both tokens that can point to the bunldes that have been copied inside the
                # pipeline configuration...
                for desc_str in [
                        "sgtk:descriptor:%s?%s={PIPELINE_CONFIG}/config/bundles/test_app"
                        % (desc_type, path_key),
                        "sgtk:descriptor:%s?%s={CONFIG_FOLDER}/bundles/test_app"
                        % (desc_type, path_key)
                ]:
                    desc = self.tk.pipeline_configuration.get_app_descriptor(
                        desc_str)
                    # Ensure the bundle is resolved inside the installed configuration.
                    self.assertEqual(
                        desc.get_path(),
                        os.path.join(self.pipeline_config_root, "config",
                                     "bundles", "test_app"))
    def test_token_resolution_with_cached_configuration(self):
        """
        Tests a cached configuration's resolving of the CONFIG_FOLDER
        """
        self.setup_fixtures()

        # For path and the platform specific path token...
        for path_key in ["path", ShotgunPath.get_shotgun_storage_key()]:
            # For both path based descriptors...
            for desc_type in ["path", "dev"]:
                desc_str = "sgtk:descriptor:%s?%s={CONFIG_FOLDER}/bundles/test_app" % (desc_type, path_key)
                desc = self.tk.pipeline_configuration.get_app_descriptor(desc_str)
                # Ensure the bundle is resolved inside the source configuration.
                self.assertEqual(
                    desc.get_path(), os.path.join(self.fixtures_root, "config", "bundles", "test_app")
                )
Exemplo n.º 3
0
    def test_token_resolution_with_cached_configuration(self):
        """
        Tests a cached configuration's resolving of the CONFIG_FOLDER
        """
        self.setup_fixtures()

        # For path and the platform specific path token...
        for path_key in ["path", ShotgunPath.get_shotgun_storage_key()]:
            # For both path based descriptors...
            for desc_type in ["path", "dev"]:
                desc_str = "sgtk:descriptor:%s?%s={CONFIG_FOLDER}/bundles/test_app" % (
                    desc_type, path_key)
                desc = self.tk.pipeline_configuration.get_app_descriptor(
                    desc_str)
                # Ensure the bundle is resolved inside the source configuration.
                self.assertEqual(
                    desc.get_path(),
                    os.path.join(self.fixtures_root, "config", "bundles",
                                 "test_app"))
    def test_token_resolution_with_installed_configuration(self):
        """
        Tests an installed configuration's resolving of the CONFIG_FOLDER and PIPELINE_CONFIG
        """
        self.setup_fixtures(parameters={"installed_config": True})

        # For path and the platform specific path token...
        for path_key in ["path", ShotgunPath.get_shotgun_storage_key()]:
            # For both path based descriptors..
            for desc_type in ["path", "dev"]:
                # For both tokens that can point to the bunldes that have been copied inside the
                # pipeline configuration...
                for desc_str in [
                    "sgtk:descriptor:%s?%s={PIPELINE_CONFIG}/config/bundles/test_app" % (desc_type, path_key),
                    "sgtk:descriptor:%s?%s={CONFIG_FOLDER}/bundles/test_app" % (desc_type, path_key)
                ]:
                    desc = self.tk.pipeline_configuration.get_app_descriptor(desc_str)
                    # Ensure the bundle is resolved inside the installed configuration.
                    self.assertEqual(
                        desc.get_path(), os.path.join(self.pipeline_config_root, "config", "bundles", "test_app")
                    )