From dab37abea925054efea5c90322db2868796eea70 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Tue, 25 Oct 2022 11:30:59 +0200 Subject: [PATCH] OP-3426 - updated filtering logic --- tests/lib/db_handler.py | 10 ++++++---- tests/lib/testing_classes.py | 7 +++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/lib/db_handler.py b/tests/lib/db_handler.py index b80a296b60..16c4650ef6 100644 --- a/tests/lib/db_handler.py +++ b/tests/lib/db_handler.py @@ -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") diff --git a/tests/lib/testing_classes.py b/tests/lib/testing_classes.py index 8aaeb4304b..ca50376584 100644 --- a/tests/lib/testing_classes.py +++ b/tests/lib/testing_classes.py @@ -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: