mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
Merge branch 'develop' into enhancement/OP-2858_move-AvalonMongoDB-logic
This commit is contained in:
commit
a579cd31c8
116 changed files with 3112 additions and 1204 deletions
|
|
@ -24,13 +24,14 @@ class DBAssert:
|
|||
else:
|
||||
args[key] = val
|
||||
|
||||
no_of_docs = dbcon.count_documents(args)
|
||||
|
||||
msg = None
|
||||
args.pop("type")
|
||||
detail_str = " "
|
||||
if args:
|
||||
detail_str = " with '{}'".format(args)
|
||||
|
||||
msg = None
|
||||
no_of_docs = dbcon.count_documents(args)
|
||||
if expected != no_of_docs:
|
||||
msg = "Not expected no of '{}'{}."\
|
||||
"Expected {}, found {}".format(queried_type,
|
||||
|
|
|
|||
|
|
@ -273,8 +273,6 @@ class PublishTest(ModuleUnitTest):
|
|||
)
|
||||
os.environ["AVALON_SCHEMA"] = schema_path
|
||||
|
||||
import openpype
|
||||
openpype.install()
|
||||
os.environ["OPENPYPE_EXECUTABLE"] = sys.executable
|
||||
from openpype.lib import ApplicationManager
|
||||
|
||||
|
|
|
|||
64
tests/unit/openpype/modules/sync_server/test_module_api.py
Normal file
64
tests/unit/openpype/modules/sync_server/test_module_api.py
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
"""Test file for Sync Server, tests API methods, currently for integrate_new
|
||||
|
||||
File:
|
||||
creates temporary directory and downloads .zip file from GDrive
|
||||
unzips .zip file
|
||||
uses content of .zip file (MongoDB's dumps) to import to new databases
|
||||
with use of 'monkeypatch_session' modifies required env vars
|
||||
temporarily
|
||||
runs battery of tests checking that site operation for Sync Server
|
||||
module are working
|
||||
removes temporary folder
|
||||
removes temporary databases (?)
|
||||
"""
|
||||
import pytest
|
||||
|
||||
from tests.lib.testing_classes import ModuleUnitTest
|
||||
|
||||
|
||||
class TestModuleApi(ModuleUnitTest):
|
||||
|
||||
REPRESENTATION_ID = "60e578d0c987036c6a7b741d"
|
||||
|
||||
TEST_FILES = [("1eCwPljuJeOI8A3aisfOIBKKjcmIycTEt",
|
||||
"test_site_operations.zip", '')]
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def setup_sync_server_module(self, dbcon):
|
||||
"""Get sync_server_module from ModulesManager"""
|
||||
from openpype.modules import ModulesManager
|
||||
|
||||
manager = ModulesManager()
|
||||
sync_server = manager.modules_by_name["sync_server"]
|
||||
yield sync_server
|
||||
|
||||
def test_get_alt_site_pairs(self, setup_sync_server_module):
|
||||
conf_sites = {"SFTP": {"alternative_sites": ["studio"]},
|
||||
"studio2": {"alternative_sites": ["studio"]}}
|
||||
|
||||
ret = setup_sync_server_module._get_alt_site_pairs(conf_sites)
|
||||
expected = {"SFTP": {"studio", "studio2"},
|
||||
"studio": {"SFTP", "studio2"},
|
||||
"studio2": {"studio", "SFTP"}}
|
||||
assert ret == expected, "Not matching result"
|
||||
|
||||
def test_get_alt_site_pairs_deep(self, setup_sync_server_module):
|
||||
conf_sites = {"A": {"alternative_sites": ["C"]},
|
||||
"B": {"alternative_sites": ["C"]},
|
||||
"C": {"alternative_sites": ["D"]},
|
||||
"D": {"alternative_sites": ["A"]},
|
||||
"F": {"alternative_sites": ["G"]},
|
||||
"G": {"alternative_sites": ["F"]},
|
||||
}
|
||||
|
||||
ret = setup_sync_server_module._get_alt_site_pairs(conf_sites)
|
||||
expected = {"A": {"B", "C", "D"},
|
||||
"B": {"A", "C", "D"},
|
||||
"C": {"A", "B", "D"},
|
||||
"D": {"A", "B", "C"},
|
||||
"F": {"G"},
|
||||
"G": {"F"}}
|
||||
assert ret == expected, "Not matching result"
|
||||
|
||||
|
||||
test_case = TestModuleApi()
|
||||
Loading…
Add table
Add a link
Reference in a new issue