mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
OP-3684 - fix output compare for automatic testing
This commit is contained in:
parent
80b6ef981a
commit
0761ba4bc3
1 changed files with 9 additions and 18 deletions
|
|
@ -314,30 +314,21 @@ class PublishTest(ModuleUnitTest):
|
|||
|
||||
Compares only presence, not size nor content!
|
||||
"""
|
||||
published_dir_base = download_test_data
|
||||
published_dir = os.path.join(output_folder_url,
|
||||
self.PROJECT,
|
||||
self.ASSET,
|
||||
self.TASK,
|
||||
"**")
|
||||
expected_dir_base = os.path.join(published_dir_base,
|
||||
published_dir_base = output_folder_url
|
||||
expected_dir_base = os.path.join(download_test_data,
|
||||
"expected")
|
||||
expected_dir = os.path.join(expected_dir_base,
|
||||
self.PROJECT,
|
||||
self.ASSET,
|
||||
self.TASK,
|
||||
"**")
|
||||
print("Comparing published:'{}' : expected:'{}'".format(published_dir,
|
||||
expected_dir))
|
||||
|
||||
print("Comparing published:'{}' : expected:'{}'".format(published_dir_base,
|
||||
expected_dir_base))
|
||||
published = set(f.replace(published_dir_base, '') for f in
|
||||
glob.glob(published_dir, recursive=True) if
|
||||
glob.glob(published_dir_base + "\\**", recursive=True) if
|
||||
f != published_dir_base and os.path.exists(f))
|
||||
expected = set(f.replace(expected_dir_base, '') for f in
|
||||
glob.glob(expected_dir, recursive=True) if
|
||||
glob.glob(expected_dir_base + "\\**", recursive=True) if
|
||||
f != expected_dir_base and os.path.exists(f))
|
||||
|
||||
not_matched = expected.difference(published)
|
||||
assert not not_matched, "Missing {} files".format(not_matched)
|
||||
not_matched = expected.symmetric_difference(published)
|
||||
assert not not_matched, "Missing {} files".format("\n".join(sorted(not_matched)))
|
||||
|
||||
|
||||
class HostFixtures(PublishTest):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue