Пример #1
0
def test_with_tk_core(tk_core_root):
    """
    Make sure we can generate documentation for tk-core
    """
    assert (tk_docs_preview.main([
        "tk_docs_preview", "--build-only", "--bundle={0}".format(tk_core_root)
    ]) == 0)
Пример #2
0
def test_with_python_api(python_api_root):
    """
    Make sure we can generate documentation for a non toolkit repo.
    """

    assert (tk_docs_preview.main([
        "tk_docs_preview", "--build-only",
        "--bundle={0}".format(python_api_root)
    ]) == 0)
Пример #3
0
def test_with_repo_without_doc(tk_config_root, tk_core_root):
    """
    Make sure the doc generation tool exits gracefully when there is no docs folder.
    """
    assert (tk_docs_preview.main([
        "tk_docs_preview",
        "--build-only",
        "--bundle={}".format(tk_config_root),
        "--core={}".format(tk_core_root),
    ]) == 0)
Пример #4
0
def test_with_tk_framework_shotgunutils(tk_framework_root, tk_core_root):
    """
    Make sure we can generate documentation for a bundle that uses tk-core
    """
    assert (tk_docs_preview.main([
        "tk_docs_preview",
        "--build-only",
        "--bundle={0}".format(tk_framework_root),
        "--core={0}".format(tk_core_root),
    ]) == 0)
Пример #5
0
def test_with_unknown_folder(tk_core_root):
    """
    Make sure the doc generation tool exits gracefully when we're not in a Toolkit
    repo
    """
    assert (tk_docs_preview.main([
        "tk_docs_preview",
        "--build-only",
        "--bundle={}".format(tempfile.gettempdir()),
        "--core={}".format(tk_core_root),
    ]) == 0)
Пример #6
0
def test_without_any_parameters(tk_framework_root):
    """
    Make sure we can generate documentation from inside a repository
    without any arguments.
    """
    cwd = os.getcwd()
    # Switch current folder to the framework so we can test both the core and
    # framework detection code path.
    os.chdir(tk_framework_root)
    try:
        assert tk_docs_preview.main(["tk_docs_preview", "--build-only"]) == 0
    finally:
        os.chdir(cwd)