mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
Updated db_asserts for Photoshop publish test
This commit is contained in:
parent
80bf891183
commit
7042330924
1 changed files with 48 additions and 20 deletions
|
|
@ -1,5 +1,10 @@
|
||||||
|
import logging
|
||||||
|
|
||||||
|
from tests.lib.assert_classes import DBAssert
|
||||||
from tests.integration.hosts.photoshop.lib import PhotoshopTestClass
|
from tests.integration.hosts.photoshop.lib import PhotoshopTestClass
|
||||||
|
|
||||||
|
log = logging.getLogger("test_publish_in_photoshop")
|
||||||
|
|
||||||
|
|
||||||
class TestPublishInPhotoshop(PhotoshopTestClass):
|
class TestPublishInPhotoshop(PhotoshopTestClass):
|
||||||
"""Basic test case for publishing in Photoshop
|
"""Basic test case for publishing in Photoshop
|
||||||
|
|
@ -30,7 +35,7 @@ class TestPublishInPhotoshop(PhotoshopTestClass):
|
||||||
{OPENPYPE_ROOT}/.venv/Scripts/python.exe {OPENPYPE_ROOT}/start.py runtests ../tests/integration/hosts/photoshop # noqa: E501
|
{OPENPYPE_ROOT}/.venv/Scripts/python.exe {OPENPYPE_ROOT}/start.py runtests ../tests/integration/hosts/photoshop # noqa: E501
|
||||||
|
|
||||||
"""
|
"""
|
||||||
PERSIST = False
|
PERSIST = True
|
||||||
|
|
||||||
TEST_FILES = [
|
TEST_FILES = [
|
||||||
("1zD2v5cBgkyOm_xIgKz3WKn8aFB_j8qC-", "test_photoshop_publish.zip", "")
|
("1zD2v5cBgkyOm_xIgKz3WKn8aFB_j8qC-", "test_photoshop_publish.zip", "")
|
||||||
|
|
@ -44,33 +49,56 @@ class TestPublishInPhotoshop(PhotoshopTestClass):
|
||||||
|
|
||||||
TIMEOUT = 120 # publish timeout
|
TIMEOUT = 120 # publish timeout
|
||||||
|
|
||||||
|
|
||||||
def test_db_asserts(self, dbcon, publish_finished):
|
def test_db_asserts(self, dbcon, publish_finished):
|
||||||
"""Host and input data dependent expected results in DB."""
|
"""Host and input data dependent expected results in DB."""
|
||||||
print("test_db_asserts")
|
print("test_db_asserts")
|
||||||
assert 3 == dbcon.count_documents({"type": "version"}), \
|
failures = []
|
||||||
"Not expected no of versions"
|
|
||||||
|
|
||||||
assert 0 == dbcon.count_documents({"type": "version",
|
failures.append(DBAssert.count_of_types(dbcon, "version", 4))
|
||||||
"name": {"$ne": 1}}), \
|
|
||||||
"Only versions with 1 expected"
|
|
||||||
|
|
||||||
assert 1 == dbcon.count_documents({"type": "subset",
|
failures.append(
|
||||||
"name": "imageMainBackgroundcopy"}
|
DBAssert.count_of_types(dbcon, "version", 0, name={"$ne": 1}))
|
||||||
), \
|
|
||||||
"modelMain subset must be present"
|
|
||||||
|
|
||||||
assert 1 == dbcon.count_documents({"type": "subset",
|
failures.append(
|
||||||
"name": "workfileTesttask"}), \
|
DBAssert.count_of_types(dbcon, "subset", 1,
|
||||||
"workfileTest_task subset must be present"
|
name="imageMainForeground"))
|
||||||
|
|
||||||
assert 6 == dbcon.count_documents({"type": "representation"}), \
|
failures.append(
|
||||||
"Not expected no of representations"
|
DBAssert.count_of_types(dbcon, "subset", 1,
|
||||||
|
name="imageMainBackground"))
|
||||||
|
|
||||||
assert 1 == dbcon.count_documents({"type": "representation",
|
failures.append(
|
||||||
"context.subset": "imageMainBackgroundcopy", # noqa: E501
|
DBAssert.count_of_types(dbcon, "subset", 1,
|
||||||
"context.ext": "png"}), \
|
name="workfileTest_task"))
|
||||||
"Not expected no of representations with ext 'png'"
|
|
||||||
|
failures.append(
|
||||||
|
DBAssert.count_of_types(dbcon, "representation", 8))
|
||||||
|
|
||||||
|
additional_args = {"context.subset": "imageMainForeground",
|
||||||
|
"context.ext": "png"}
|
||||||
|
failures.append(
|
||||||
|
DBAssert.count_of_types(dbcon, "representation", 1,
|
||||||
|
additional_args=additional_args))
|
||||||
|
|
||||||
|
additional_args = {"context.subset": "imageMainForeground",
|
||||||
|
"context.ext": "jpg"}
|
||||||
|
failures.append(
|
||||||
|
DBAssert.count_of_types(dbcon, "representation", 1,
|
||||||
|
additional_args=additional_args))
|
||||||
|
|
||||||
|
additional_args = {"context.subset": "imageMainBackground",
|
||||||
|
"context.ext": "png"}
|
||||||
|
failures.append(
|
||||||
|
DBAssert.count_of_types(dbcon, "representation", 1,
|
||||||
|
additional_args=additional_args))
|
||||||
|
|
||||||
|
additional_args = {"context.subset": "imageMainBackground",
|
||||||
|
"context.ext": "jpg"}
|
||||||
|
failures.append(
|
||||||
|
DBAssert.count_of_types(dbcon, "representation", 1,
|
||||||
|
additional_args=additional_args))
|
||||||
|
|
||||||
|
assert not any(failures)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue