diff --git a/api/test/test_edr.py b/api/test/test_edr.py index d8a2bf20..3f3fe888 100644 --- a/api/test/test_edr.py +++ b/api/test/test_edr.py @@ -27,10 +27,10 @@ def test_get_locations_id_with_single_parameter_query_without_format(): mock_getObsRequest.assert_called_once() assert "ff" in mock_getObsRequest.call_args[0][0].filter["instrument"].values assert "06260" in mock_getObsRequest.call_args[0][0].filter["platform"].values - assert "2022-12-31 00:00:00" == mock_getObsRequest.call_args[0][0].interval.start.ToDatetime().strftime( - "%Y-%m-%d %H:%M:%S" - ) - assert "2022-12-31 01:00:01" == mock_getObsRequest.call_args[0][0].interval.end.ToDatetime().strftime( + assert "2022-12-31 00:00:00" == mock_getObsRequest.call_args[0][ + 0 + ].temporal_interval.start.ToDatetime().strftime("%Y-%m-%d %H:%M:%S") + assert "2022-12-31 01:00:01" == mock_getObsRequest.call_args[0][0].temporal_interval.end.ToDatetime().strftime( "%Y-%m-%d %H:%M:%S" ) @@ -101,12 +101,12 @@ def test_get_area_with_normal_query(): # Check that getObsRequest gets called with correct arguments given in query mock_getObsRequest.assert_called_once() assert "TA_P1D_AVG" in mock_getObsRequest.call_args[0][0].filter["instrument"].values - assert len(mock_getObsRequest.call_args[0][0].inside.points) == 5 - assert 22.12 == mock_getObsRequest.call_args[0][0].inside.points[0].lon - assert "2022-12-31 00:00:00" == mock_getObsRequest.call_args[0][0].interval.start.ToDatetime().strftime( - "%Y-%m-%d %H:%M:%S" - ) - assert "2022-12-31 01:00:01" == mock_getObsRequest.call_args[0][0].interval.end.ToDatetime().strftime( + assert len(mock_getObsRequest.call_args[0][0].spatial_area.points) == 5 + assert 22.12 == mock_getObsRequest.call_args[0][0].spatial_area.points[0].lon + assert "2022-12-31 00:00:00" == mock_getObsRequest.call_args[0][ + 0 + ].temporal_interval.start.ToDatetime().strftime("%Y-%m-%d %H:%M:%S") + assert "2022-12-31 01:00:01" == mock_getObsRequest.call_args[0][0].temporal_interval.end.ToDatetime().strftime( "%Y-%m-%d %H:%M:%S" )