def test_get_single_upstream_artifact_full_path(context): folder = os.path.join(context.config['work_dir'], 'cot', 'dependency1') assert get_single_upstream_artifact_full_path(context, 'dependency1', 'public/file_a') == \ os.path.join(context.config['work_dir'], 'cot', 'dependency1', 'public', 'file_a') assert get_single_upstream_artifact_full_path(context, 'dependency1', 'public/non_existing_file') == \ os.path.join(context.config['work_dir'], 'cot', 'dependency1', 'public', 'non_existing_file') assert get_single_upstream_artifact_full_path(context, 'non-existing-dep', 'public/file_a') == \ os.path.join(context.config['work_dir'], 'cot', 'non-existing-dep', 'public', 'file_a')
def test_get_single_upstream_artifact_full_path(context): os.path.join(context.config["work_dir"], "cot", "dependency1") assert get_single_upstream_artifact_full_path( context, "dependency1", "public/file_a") == os.path.join(context.config["work_dir"], "cot", "dependency1", "public", "file_a") assert get_single_upstream_artifact_full_path( context, "dependency1", "public/non_existing_file") == os.path.join(context.config["work_dir"], "cot", "dependency1", "public", "non_existing_file") assert get_single_upstream_artifact_full_path( context, "non-existing-dep", "public/file_a") == os.path.join(context.config["work_dir"], "cot", "non-existing-dep", "public", "file_a")
def get_artifact_full_path(self, path): """str: the full path where an artifact should be located.""" return get_single_upstream_artifact_full_path(self.context, self.task_id, path)