Skip to content

Commit

Permalink
test: adapting the test to the new release (#86)
Browse files Browse the repository at this point in the history
for testing purposes
  • Loading branch information
uriii3 authored Jun 28, 2024
1 parent feec233 commit 14265a8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 22 deletions.
12 changes: 6 additions & 6 deletions tests/test_command_line_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,8 @@ def test_if_dataset_coordinate_valid_minmax_attributes_are_setted(
self.base_request_dict = {
"--dataset-id": "cmems_mod_glo_phy-so_anfc_0.083deg_P1D-m",
"--variable": "so",
"--start-datetime": "2021-01-01",
"--end-datetime": "2021-01-02",
"--start-datetime": "2024-01-01",
"--end-datetime": "2024-01-02",
"--minimum-latitude": "0.0",
"--maximum-latitude": "0.1",
"--minimum-longitude": "0.2",
Expand All @@ -553,8 +553,8 @@ def test_if_dataset_coordinate_valid_minmax_attributes_are_setted(
assert dataset.longitude.attrs["valid_max"] <= 0.3
assert dataset.depth.attrs["valid_min"] >= 0
assert dataset.depth.attrs["valid_max"] <= 5
assert dataset.time.attrs["valid_min"] == 622392
assert dataset.time.attrs["valid_max"] == 622416
assert dataset.time.attrs["valid_min"] == 648672
assert dataset.time.attrs["valid_max"] == 648696

def test_retention_period_works(self):
self.command = [
Expand Down Expand Up @@ -1301,9 +1301,9 @@ def test_subset_with_chunking(self, tmp_path):
"-i",
"cmems_mod_glo_phy-cur_anfc_0.083deg_P1D-m",
"-t",
"2021-01-01T00:00:00",
"2024-01-01T00:00:00",
"-T",
"2021-01-05T23:59:59",
"2024-01-05T23:59:59",
"-v",
"uo",
"-x",
Expand Down
7 changes: 1 addition & 6 deletions tests/test_get_index_files_insitu.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@ def test_get_index_insitu_files(self):
"cmems_obs-ins_glo_phybgcwav_mynrt_na_irr",
"--index-parts",
]
self.output = execute_in_terminal(self.command)
self.output = execute_in_terminal(self.command, input=b"n\n")

assert (
b"s3://mdl-native-01/native/INSITU_GLO_PHYBGCWAV_DISCRETE_MYNRT_013_030"
b"/cmems_obs-ins_glo_phybgcwav_mynrt_na_irr_202311/index_reference.txt"
in self.output.stdout
)
assert (
b"s3://mdl-native-01/native/INSITU_GLO_PHYBGCWAV_DISCRETE_MYNRT_013_030"
b"/cmems_obs-ins_glo_phybgcwav_mynrt_na_irr_202311/index_history.txt"
Expand Down
4 changes: 2 additions & 2 deletions tests/test_longitudes_with_modulus.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def _build_custom_command(
"--maximum-latitude",
"35.03",
"--start-datetime",
"2021-01-01",
"2024-01-01",
"--end-datetime",
"2021-01-05",
"2024-01-05",
"-o",
f"{folder}",
"-f",
Expand Down
16 changes: 8 additions & 8 deletions tests/test_python_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def test_subset_function(self, tmp_path):
password=os.getenv("COPERNICUSMARINE_SERVICE_PASSWORD"),
dataset_id="cmems_mod_glo_phy-so_anfc_0.083deg_P1D-m",
variables=["so"],
start_datetime=datetime(year=2021, month=1, day=1),
end_datetime=datetime(year=2021, month=1, day=2),
start_datetime=datetime(year=2024, month=1, day=1),
end_datetime=datetime(year=2024, month=1, day=2),
minimum_latitude=0.0,
maximum_latitude=0.1,
minimum_longitude=0.2,
Expand All @@ -63,8 +63,8 @@ def test_open_dataset(self):
username=os.getenv("COPERNICUSMARINE_SERVICE_USERNAME"),
password=os.getenv("COPERNICUSMARINE_SERVICE_PASSWORD"),
dataset_id="cmems_mod_glo_phy-so_anfc_0.083deg_P1D-m",
start_datetime=datetime(year=2021, month=1, day=1),
end_datetime=datetime(year=2021, month=1, day=2),
start_datetime=datetime(year=2024, month=1, day=1),
end_datetime=datetime(year=2024, month=1, day=2),
minimum_latitude=0.0,
maximum_latitude=0.1,
minimum_longitude=0.2,
Expand All @@ -77,8 +77,8 @@ def test_read_dataframe(self):
username=os.getenv("COPERNICUSMARINE_SERVICE_USERNAME"),
password=os.getenv("COPERNICUSMARINE_SERVICE_PASSWORD"),
dataset_id="cmems_mod_glo_phy-so_anfc_0.083deg_P1D-m",
start_datetime=datetime(year=2021, month=1, day=1),
end_datetime=datetime(year=2021, month=1, day=2),
start_datetime=datetime(year=2024, month=1, day=1),
end_datetime=datetime(year=2024, month=1, day=2),
minimum_latitude=0.0,
maximum_latitude=0.1,
minimum_longitude=0.2,
Expand Down Expand Up @@ -183,8 +183,8 @@ def test_read_dataframe_with_strict_method(self, caplog):
username=os.getenv("COPERNICUSMARINE_SERVICE_USERNAME"),
password=os.getenv("COPERNICUSMARINE_SERVICE_PASSWORD"),
dataset_id="cmems_mod_glo_phy-so_anfc_0.083deg_P1D-m",
start_datetime=datetime(year=2021, month=1, day=1),
end_datetime=datetime(year=2021, month=1, day=2),
start_datetime=datetime(year=2024, month=1, day=1),
end_datetime=datetime(year=2024, month=1, day=2),
minimum_latitude=0.0,
maximum_latitude=0.1,
minimum_longitude=0.2,
Expand Down

0 comments on commit 14265a8

Please sign in to comment.