Skip to content

Commit

Permalink
Merge a203ee0 into 9aed39c
Browse files Browse the repository at this point in the history
  • Loading branch information
jfboismenu committed May 2, 2019
2 parents 9aed39c + a203ee0 commit be05810
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 1 deletion.
70 changes: 70 additions & 0 deletions tests/fixtures/config/core/roots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Copyright (c) 2015 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights
# not expressly granted therein are reserved by Shotgun Software Inc.

# ------------------------------------------------------------------------------
# This file defines all the different disk locations that this config uses.
#
# Root definitions are referenced from the toolkit configuration's templates.yml
# file and folder creation schema.
#
# At setup time, each defined root is looked up against the local storages
# defined in shotgun. For each root defined in this file, a local storage needs
# to exist in Shotgun. The `shotgun_storage_id` key in each root definition
# below should correspond to a local storage in Shotgun. This allows the roots
# defined here to be called anything, making it possible to reuse the
# configuration without changing references to the storage root, only the
# associated SG storage id. If the `shotgun_storage_key` is not defined, then
# the root name must match the name of the storage in SG (legacy fallback).
#
# NOTE: Local storages ids can only be retrieved via the API currently:
#
# # get all local storages defined in SG
# shotgun.find("LocalStorage", [], ["code"])
#
# One of the roots defined in this file should have a `default` key with a value
# of `true` to identify the default storage root to use when none is specified
# for a path template. If no roots are identified a `default`, then one root
# must be named `primary` which will indicate the default root.
#
# During setup, the paths defined for each local storage are transferred across
# to this file.
#
# Note: In toolkit core versions prior to 0.18.121, configurations using a
# single root required this root to be named 'primary'. In later versions of
# core, this requirement has been lifted and the root can be named anything.
# ------------------------------------------------------------------------------

primary:

description: A top-level root folder for production data. Project folders
will be created beneath this location.

# these paths will be populated by the associated local storage in Shotgun
# at setup time.
mac_path:
linux_path:
windows_path:

# indicates that this is the default storage root
default: true

# ------------------------------------------------------------------------------
# Below is an example of a second storage root. This root would require a local
# storage defined in Shotgun with an id of 2.
#
# textures:
# mac_path: /studio/textures
# linux_path: /studio/textures
# windows_path:
#
# description: "High performance storage for fast/frequent texture access"
# shotgun_storage_id: 2
#

8 changes: 7 additions & 1 deletion tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,21 @@ def launch_engine():
user = sgtk.authentication.ShotgunAuthenticator().get_user()
sg = user.create_sg_connection()

project = sg.find_one("Project", [["tank_name", "is_not", None]])
if project is None:
raise RuntimeError("You need at least one project with the Project.tank_name field set.")

# Bootstrap
manager = sgtk.bootstrap.ToolkitManager(user)
manager.plugin_id = "basic.shell"
manager.base_configuration = "sgtk:descriptor:path?path=$REPO_ROOT/tests/fixtures/config"
manager.do_shotgun_config_lookup = False
manager.progress_callback = progress_callback


return manager.bootstrap_engine(
"tk-shell",
sg.find_one("Project", [])
project
)


Expand Down

0 comments on commit be05810

Please sign in to comment.