Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Create test publish class for After Effects #2270

Merged
merged 6 commits into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openpype/lib/remote_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def headless_publish(log, close_plugin_name=None, is_test=False):

publish_and_log(dbcon, _id, log, close_plugin_name)
else:
publish(log, 'CloseAE')
publish(log, close_plugin_name)


def get_webpublish_conn():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ class TestPublishInAfterEffects(PublishTest):

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.
Expand All @@ -21,13 +26,13 @@ class TestPublishInAfterEffects(PublishTest):
PERSIST = True

TEST_FILES = [
("1qsrq6OJWVpOeXE2LTWrdbsLqEVu155Uf",
("1c8261CmHwyMgS-g7S4xL5epAp0jCBmhf",
"test_aftereffects_publish.zip",
"")
]

APP = "aftereffects"
APP_VARIANT = "2021"
APP_VARIANT = "2022"

APP_NAME = "{}/{}".format(APP, APP_VARIANT)

Expand Down Expand Up @@ -63,33 +68,33 @@ def startup_scripts(self, monkeypatch_session, download_test_data):
def test_db_asserts(self, dbcon, publish_finished):
"""Host and input data dependent expected results in DB."""
print("test_db_asserts")
assert 5 == dbcon.count_documents({"type": "version"}), \
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": "modelMain"}), \
"name": "imageMainBackgroundcopy"
}), \
"modelMain subset must be present"

assert 1 == dbcon.count_documents({"type": "subset",
"name": "workfileTest_task"}), \
"workfileTest_task subset must be present"
"name": "workfileTesttask"}), \
"workfileTesttask subset must be present"

assert 11 == dbcon.count_documents({"type": "representation"}), \
"Not expected no of representations"
assert 1 == dbcon.count_documents({"type": "subset",
"name": "reviewTesttask"}), \
"reviewTesttask subset must be present"

assert 2 == dbcon.count_documents({"type": "representation",
"context.subset": "modelMain",
"context.ext": "abc"}), \
"Not expected no of representations with ext 'abc'"
assert 6 == dbcon.count_documents({"type": "representation"}), \
"Not expected no of representations"

assert 2 == dbcon.count_documents({"type": "representation",
"context.subset": "modelMain",
"context.ext": "ma"}), \
"Not expected no of representations with ext 'abc'"
assert 1 == dbcon.count_documents({"type": "representation",
"context.subset": "imageMainBackgroundcopy", #noqa E501
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline comment should start with '# '
line too long (99 > 79 characters)

"context.ext": "png"}), \
"Not expected no of representations with ext 'png'"


if __name__ == "__main__":
Expand Down
31 changes: 16 additions & 15 deletions tests/integration/hosts/photoshop/test_publish_in_photoshop.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ class TestPublishInPhotoshop(PublishTest):
Uses generic TestCase to prepare fixtures for test data, testing DBs,
env vars.

Opens Maya, run publish on prepared workile.
Opens Photoshop, 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.
Expand All @@ -21,7 +26,7 @@ class TestPublishInPhotoshop(PublishTest):
PERSIST = True

TEST_FILES = [
("1Bciy2pCwMKl1UIpxuPnlX_LHMo_Xkq0K", "test_photoshop_publish.zip", "")
("1zD2v5cBgkyOm_xIgKz3WKn8aFB_j8qC-", "test_photoshop_publish.zip", "")
]

APP = "photoshop"
Expand Down Expand Up @@ -61,33 +66,29 @@ def startup_scripts(self, monkeypatch_session, download_test_data):
def test_db_asserts(self, dbcon, publish_finished):
"""Host and input data dependent expected results in DB."""
print("test_db_asserts")
assert 5 == dbcon.count_documents({"type": "version"}), \
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": "modelMain"}), \
"name": "imageMainBackgroundcopy"}
), \
"modelMain subset must be present"

assert 1 == dbcon.count_documents({"type": "subset",
"name": "workfileTest_task"}), \
"name": "workfileTesttask"}), \
"workfileTest_task subset must be present"

assert 11 == dbcon.count_documents({"type": "representation"}), \
assert 6 == dbcon.count_documents({"type": "representation"}), \
"Not expected no of representations"

assert 2 == dbcon.count_documents({"type": "representation",
"context.subset": "modelMain",
"context.ext": "abc"}), \
"Not expected no of representations with ext 'abc'"

assert 2 == dbcon.count_documents({"type": "representation",
"context.subset": "modelMain",
"context.ext": "ma"}), \
"Not expected no of representations with ext 'abc'"
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__":
Expand Down