Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: adapting the test to the new release #86

Merged
merged 3 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 2 additions & 2 deletions tests/test_get_index_files_insitu.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ 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
not in self.output.stdout
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This we should either get rid of the test or find another example, because with the "not in" we are not testing anything

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, cool, I see your point!

)
assert (
b"s3://mdl-native-01/native/INSITU_GLO_PHYBGCWAV_DISCRETE_MYNRT_013_030"
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