OP-3426 - updated filtering logic

This commit is contained in:
Petr Kalis 2022-10-25 11:30:59 +02:00
parent f73330565e
commit dab37abea9
2 changed files with 11 additions and 6 deletions

View file

@ -228,12 +228,14 @@ class DBHandler:
return query
# Examples
# handler = DBHandler(uri="mongodb://localhost:27017")
handler = DBHandler(uri="mongodb://localhost:27017")
# #
# backup_dir = "c:\\projects\\test_zips\\test_maya_publish\\input\\dumps"
backup_dir = "c:\\projects\\test_zips\\test_nuke_deadline_publish\\input\\dumps"
# # #
# handler.backup_to_dump("avalon", backup_dir, True, collection="test_project")
# handler.setup_from_dump("avalon_tests", backup_dir, True, db_name_out="avalon", collection="test_project")
handler.backup_to_dump("avalon_tests", backup_dir, True, collection="test_project")
#handler.backup_to_dump("openpype_tests", backup_dir, True, collection="settings")
# handler.setup_from_dump("avalon_tests", backup_dir, True, db_name_out="avalon_tests", collection="test_project")
# handler.setup_from_sql_file("avalon_tests", "c:\\projects\\sql\\item.sql",
# collection="test_project",
# drop=False, mode="upsert")

View file

@ -338,9 +338,12 @@ class PublishTest(ModuleUnitTest):
filtered_published = set()
for pub_path in published:
for val in skip_compare_folders:
if not re.search(val, pub_path):
if skip_compare_folders:
if not any([re.search(val, pub_path)
for val in skip_compare_folders]):
filtered_published.add(pub_path)
else:
filtered_published.add(pub_path)
not_matched = expected.symmetric_difference(filtered_published)
if not_matched: