diff --git a/tests/integration/hosts/maya/test_publish_in_maya.py b/tests/integration/hosts/maya/test_publish_in_maya.py index 687e6fbc6e..5f3a550c6a 100644 --- a/tests/integration/hosts/maya/test_publish_in_maya.py +++ b/tests/integration/hosts/maya/test_publish_in_maya.py @@ -39,7 +39,7 @@ class TestPublishInMaya(PublishTest): TIMEOUT = 120 # publish timeout @pytest.fixture(scope="module") - def last_workfile_path(self, download_test_data): + def last_workfile_path(self, download_test_data, output_folder_url): """Get last_workfile_path from source data. Maya expects workfile in proper folder, so copy is done first. @@ -48,7 +48,7 @@ class TestPublishInMaya(PublishTest): "input", "workfile", "test_project_test_asset_TestTask_v001.mb") - dest_folder = os.path.join(download_test_data, + dest_folder = os.path.join(output_folder_url, self.PROJECT, self.ASSET, "work", diff --git a/tests/integration/hosts/nuke/test_publish_in_nuke.py b/tests/integration/hosts/nuke/test_publish_in_nuke.py index a5a09bdd04..797bc0a9d3 100644 --- a/tests/integration/hosts/nuke/test_publish_in_nuke.py +++ b/tests/integration/hosts/nuke/test_publish_in_nuke.py @@ -52,7 +52,7 @@ class TestPublishInNuke(PublishTest): "input", "workfile", source_file_name) - dest_folder = os.path.join(download_test_data, + dest_folder = os.path.join(output_folder_url, self.PROJECT, self.ASSET, "work", diff --git a/tests/integration/hosts/photoshop/test_publish_in_photoshop.py b/tests/integration/hosts/photoshop/test_publish_in_photoshop.py index c7f2399494..541552fedf 100644 --- a/tests/integration/hosts/photoshop/test_publish_in_photoshop.py +++ b/tests/integration/hosts/photoshop/test_publish_in_photoshop.py @@ -37,7 +37,7 @@ class TestPublishInPhotoshop(PublishTest): TIMEOUT = 120 # publish timeout @pytest.fixture(scope="module") - def last_workfile_path(self, download_test_data): + def last_workfile_path(self, download_test_data, output_folder_url): """Get last_workfile_path from source data. Maya expects workfile in proper folder, so copy is done first. @@ -46,7 +46,7 @@ class TestPublishInPhotoshop(PublishTest): "input", "workfile", "test_project_test_asset_TestTask_v001.psd") - dest_folder = os.path.join(download_test_data, + dest_folder = os.path.join(output_folder_url, self.PROJECT, self.ASSET, "work", diff --git a/tests/lib/testing_classes.py b/tests/lib/testing_classes.py index 40363e928f..ad637e6974 100644 --- a/tests/lib/testing_classes.py +++ b/tests/lib/testing_classes.py @@ -215,7 +215,17 @@ class PublishTest(ModuleUnitTest): yield "{}/{}".format(self.APP, app_variant) @pytest.fixture(scope="module") - def last_workfile_path(self, download_test_data): + def output_folder_url(self, download_test_data): + """Returns location of published data, cleans it first if exists.""" + path = os.path.join(download_test_data, "output") + if os.path.exists(path): + print("Purging {}".format(path)) + shutil.rmtree(path) + yield path + + @pytest.fixture(scope="module") + def last_workfile_path(self, download_test_data, output_folder_url): + """Returns url of workfile""" raise NotImplementedError @pytest.fixture(scope="module") @@ -251,15 +261,16 @@ class PublishTest(ModuleUnitTest): @pytest.fixture(scope="module") def launched_app(self, dbcon, download_test_data, last_workfile_path, - startup_scripts, app_args): + startup_scripts, app_args, app_name, output_folder_url): """Launch host app""" # set publishing folders - root_key = "config.roots.work.{}".format("windows") # TEMP + platform_str = platform.system().lower() + root_key = "config.roots.work.{}".format(platform_str) dbcon.update_one( {"type": "project"}, {"$set": { - root_key: download_test_data + root_key: output_folder_url }} )