This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2270 from pypeclub/feature/OP-2019_Create-test-pu…
…blish-class-for-AE Create test publish class for After Effects
- Loading branch information
Showing
3 changed files
with
116 additions
and
16 deletions.
There are no files selected for viewing
Submodule avalon-core
updated
from 85c656 to 7e5efd
101 changes: 101 additions & 0 deletions
101
tests/integration/hosts/aftereffects/test_publish_in_aftereffects.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import pytest | ||
import os | ||
import shutil | ||
|
||
from tests.lib.testing_classes import PublishTest | ||
|
||
|
||
class TestPublishInAfterEffects(PublishTest): | ||
"""Basic test case for publishing in AfterEffects | ||
Uses generic TestCase to prepare fixtures for test data, testing DBs, | ||
env vars. | ||
Opens AfterEffects, run publish on prepared workile. | ||
Test zip file sets 3 required env vars: | ||
- HEADLESS_PUBLISH - this triggers publish immediately app is open | ||
- IS_TEST - this differentiate between regular webpublish | ||
- PYBLISH_TARGETS | ||
Then checks content of DB (if subset, version, representations were | ||
created. | ||
Checks tmp folder if all expected files were published. | ||
""" | ||
PERSIST = True | ||
|
||
TEST_FILES = [ | ||
("1c8261CmHwyMgS-g7S4xL5epAp0jCBmhf", | ||
"test_aftereffects_publish.zip", | ||
"") | ||
] | ||
|
||
APP = "aftereffects" | ||
APP_VARIANT = "2022" | ||
|
||
APP_NAME = "{}/{}".format(APP, APP_VARIANT) | ||
|
||
TIMEOUT = 120 # publish timeout | ||
|
||
@pytest.fixture(scope="module") | ||
def last_workfile_path(self, download_test_data): | ||
"""Get last_workfile_path from source data. | ||
Maya expects workfile in proper folder, so copy is done first. | ||
""" | ||
src_path = os.path.join(download_test_data, | ||
"input", | ||
"workfile", | ||
"test_project_test_asset_TestTask_v001.aep") | ||
dest_folder = os.path.join(download_test_data, | ||
self.PROJECT, | ||
self.ASSET, | ||
"work", | ||
self.TASK) | ||
os.makedirs(dest_folder) | ||
dest_path = os.path.join(dest_folder, | ||
"test_project_test_asset_TestTask_v001.aep") | ||
shutil.copy(src_path, dest_path) | ||
|
||
yield dest_path | ||
|
||
@pytest.fixture(scope="module") | ||
def startup_scripts(self, monkeypatch_session, download_test_data): | ||
"""Points AfterEffects to userSetup file from input data""" | ||
pass | ||
|
||
def test_db_asserts(self, dbcon, publish_finished): | ||
"""Host and input data dependent expected results in DB.""" | ||
print("test_db_asserts") | ||
assert 3 == dbcon.count_documents({"type": "version"}), \ | ||
"Not expected no of versions" | ||
|
||
assert 0 == dbcon.count_documents({"type": "version", | ||
"name": {"$ne": 1}}), \ | ||
"Only versions with 1 expected" | ||
|
||
assert 1 == dbcon.count_documents({"type": "subset", | ||
"name": "imageMainBackgroundcopy" | ||
}), \ | ||
"modelMain subset must be present" | ||
|
||
assert 1 == dbcon.count_documents({"type": "subset", | ||
"name": "workfileTesttask"}), \ | ||
"workfileTesttask subset must be present" | ||
|
||
assert 1 == dbcon.count_documents({"type": "subset", | ||
"name": "reviewTesttask"}), \ | ||
"reviewTesttask subset must be present" | ||
|
||
assert 6 == dbcon.count_documents({"type": "representation"}), \ | ||
"Not expected no of representations" | ||
|
||
assert 1 == dbcon.count_documents({"type": "representation", | ||
"context.subset": "imageMainBackgroundcopy", #noqa E501 | ||
"context.ext": "png"}), \ | ||
"Not expected no of representations with ext 'png'" | ||
|
||
|
||
if __name__ == "__main__": | ||
test_case = TestPublishInAfterEffects() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters