-
Notifications
You must be signed in to change notification settings - Fork 22
/
tests.py
118 lines (100 loc) · 2.58 KB
/
tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import os
import sys
import shutil
import tempfile
from launcher import schema
from launcher.vendor import yaml
self = sys.modules[__name__]
def setup():
self.root = tempfile.mkdtemp()
self.config = {
"schema": "avalon-core:config-1.0",
"apps": [
{
"name": "maya2016"
},
{
"name": "python",
"args": [
"-u",
"-c",
"print('Something nice')"
]
}
],
"tasks": [
{
"label": "animation",
"name": "animation"
}
],
"template": {
"publish": "{projectpath}/publish",
"work": "{projectpath}/work"
}
}
self.inventory = {
"schema": "avalon-core:inventory-1.0",
"assets": {
"Batman": None,
"Tarantula": None
},
"film": {
"1000": {
"edit_in": 1000,
"edit_out": 1143
},
"1200": {
"edit_in": 1000,
"edit_out": 1081
},
"2000": None,
"2100": None,
"2400": None
}
}
self.application = {
"schema": "avalon-core:application-1.0",
"label": "Autodesk Maya 2016x64",
"description": "",
"application_dir": "maya",
"executable": "maya2016",
"default_dirs": [
"scenes",
"data",
],
"environment": {
"MAYA_DISABLE_CLIC_IPM": "Yes",
"PYTHONPATH": [
"{PYBLISH_MAYA}/pyblish_maya/pythonpath",
"{AVALON_CORE}/avalon/maya/pythonpath",
"{PYTHONPATH}"
]
},
"arguments": [
"-proj",
"{AVALON_WORKDIR}"
],
"copy": {
"{AVALON_CORE}/res/workspace.mel":
"{AVALON_WORKDIR}/workspace.mel"
}
}
os.environ["PATH"] += os.pathsep.join([
os.environ["PATH"],
self.root
])
with open(os.path.join(self.root, "python.yml"), "w") as f:
yaml.dump({
"executable": "python",
"application_dir": "python",
"label": "Python 2.7"
}, f)
def teardown():
shutil.rmtree(self.root)
def test_config():
schema.validate(self.config, "config")
def test_inventory():
schema.validate(self.inventory, "inventory")
def test_application():
schema.validate(self.application, "application")