<commit_before>"""Integration tests

These tests include external libraries in order to test
the integration between them.

"""

import os
import sys
import shutil
import tempfile

from maya import cmds

import pyblish_maya
import pyblish.api
import pyblish.util

from mindbender import api, maya

from nose.tools import (
    assert_equals,
    with_setup
)

self = sys.modules[__name__]
self.tempdir = None


def setup():
    pyblish_maya.setup()
    api.install(maya)

    self.tempdir = tempfile.mkdtemp()

    assetdir = os.path.join(
        self.tempdir,
        "assets",
        "Test"
    )

    os.makedirs(assetdir)

    api.register_root(self.tempdir)
    assert api.registered_root() == self.tempdir
    api.register_silo("assets")

    # Setup environment
    os.environ["MINDBENDER_ASSETPATH"] = assetdir
    os.environ["MINDBENDER_SILO"] = "assets"


def teardown():
    pyblish_maya.teardown()
    api.uninstall()

    shutil.rmtree(self.tempdir)


def clear():
    shutil.rmtree(self.tempdir)
    self.tempdir = tempfile.mkdtemp()

    cmds.file(new=True, force=True)
    cmds.file(rename="temp.ma")
<commit_msg>add extra enviroment variables for test setup<commit_after>"""Integration tests

These tests include external libraries in order to test
the integration between them.

"""

import os
import sys
import shutil
import tempfile

from maya import cmds

import pyblish_maya
import pyblish.api
import pyblish.util

from mindbender import api, maya

from nose.tools import (
    assert_equals,
    with_setup
)

self = sys.modules[__name__]
self.tempdir = None


def setup():
    pyblish_maya.setup()
    api.install(maya)

    self.tempdir = tempfile.mkdtemp()

    assetdir = os.path.join(
        self.tempdir,
        "assets",
        "Test"
    )

    os.makedirs(assetdir)

    api.register_root(self.tempdir)
    assert api.registered_root() == self.tempdir
    api.register_silo("assets")

    # Setup environment
    os.environ["MINDBENDER_ASSETPATH"] = assetdir
    os.environ["MINDBENDER_SILO"] = "assets"
    os.environ["MINDBENDER_FPS"] = "30"
    os.environ["MINDBENDER_EDIT_IN"] = ""
    os.environ["MINDBENDER_EDIT_OUT"] = ""


def teardown():
    pyblish_maya.teardown()
    api.uninstall()

    shutil.rmtree(self.tempdir)


def clear():
    shutil.rmtree(self.tempdir)
    self.tempdir = tempfile.mkdtemp()

    cmds.file(new=True, force=True)
    cmds.file(rename="temp.ma")

{'fraction_non_alphanumeric': 0.10913600661430344, 'fraction_numerical': 0.0008267879288962381, 'mean_word_length': 3.4403669724770642, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6704520', 'n_tokens_mistral': 864, 'n_tokens_neox': 852, 'n_words': 176}