From c47581a51645a24f64870867623e4d750ea7c651 Mon Sep 17 00:00:00 2001 From: BRAUN REMI Date: Mon, 23 Dec 2024 15:16:37 +0100 Subject: [PATCH] Fix CI --- ci/test_archives.py | 2 +- ci/test_ci.py | 9 ++++++--- ci/test_files.py | 2 +- ci/test_path.py | 2 +- ci/test_vectors.py | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ci/test_archives.py b/ci/test_archives.py index d6e6801..8283d6d 100644 --- a/ci/test_archives.py +++ b/ci/test_archives.py @@ -2,9 +2,9 @@ import shutil import pytest -from CI.SCRIPTS.script_utils import files_path, s3_env from lxml import etree, html +from ci.script_utils import files_path, s3_env from sertit import archives, ci, files, path, s3, vectors diff --git a/ci/test_ci.py b/ci/test_ci.py index 0e2125d..3625bfb 100644 --- a/ci/test_ci.py +++ b/ci/test_ci.py @@ -19,9 +19,9 @@ import tempfile import pytest -from CI.SCRIPTS.script_utils import files_path, rasters_path, s3_env, vectors_path from lxml import etree +from ci.script_utils import files_path, rasters_path, s3_env, vectors_path from sertit import ci, path, rasters, rasters_rio, s3, vectors ci.reduce_verbosity() @@ -67,13 +67,16 @@ def test_assert_dir(): @s3_env -def test_assert_files(): +def test_assert_files(tmp_path): """Test CI functions""" ok_path = files_path().joinpath("productPreview.html") false_path = files_path().joinpath("false.html") ci.assert_files_equal(ok_path, ok_path) - ci.assert_files_equal(str(ok_path), str(ok_path)) + if path.is_cloud_path(ok_path): + str_ok_path = str(s3.download(ok_path, tmp_path)) + + ci.assert_files_equal(str_ok_path, str_ok_path) with pytest.raises(AssertionError): ci.assert_files_equal(ok_path, false_path) diff --git a/ci/test_files.py b/ci/test_files.py index b5233c2..d8de011 100644 --- a/ci/test_files.py +++ b/ci/test_files.py @@ -20,8 +20,8 @@ from datetime import date, datetime import numpy as np -from CI.SCRIPTS.script_utils import Polarization +from ci.script_utils import Polarization from sertit import AnyPath, ci, files ci.reduce_verbosity() diff --git a/ci/test_path.py b/ci/test_path.py index bb94f47..6da5458 100644 --- a/ci/test_path.py +++ b/ci/test_path.py @@ -19,8 +19,8 @@ import tempfile import pytest -from CI.SCRIPTS.script_utils import get_s3_ci_path +from ci.script_utils import get_s3_ci_path from sertit import AnyPath, ci, misc, path ci.reduce_verbosity() diff --git a/ci/test_vectors.py b/ci/test_vectors.py index 750435d..3aea31d 100644 --- a/ci/test_vectors.py +++ b/ci/test_vectors.py @@ -21,9 +21,9 @@ import geopandas as gpd import pytest -from CI.SCRIPTS.script_utils import KAPUT_KWARGS, files_path, s3_env, vectors_path from shapely import wkt +from ci.script_utils import KAPUT_KWARGS, files_path, s3_env, vectors_path from sertit import archives, ci, files, path, vectors from sertit.vectors import EPSG_4326, DataSourceError