Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cmarshak committed Aug 28, 2023
1 parent 22e609c commit c473b10
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions test/test_GUNW.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,10 @@ def test_azimuth_timing_against_interpolation(weather_model_name: str,
mocker.patch('hyp3lib.get_orb.downloadSentinelOrbitFile',
# Hyp3 Lib returns 2 values
side_effect=[
# For center time
(orbit_dict_for_azimuth_time_test['reference'], ''),
(orbit_dict_for_azimuth_time_test['secondary'], ''),
# For azimuth time
(orbit_dict_for_azimuth_time_test['reference'], ''),
(orbit_dict_for_azimuth_time_test['secondary'], ''),
(orbit_dict_for_azimuth_time_test['secondary'], ''),
]
)

Expand All @@ -216,12 +214,13 @@ def test_azimuth_timing_against_interpolation(weather_model_name: str,

# These outputs are not needed since the orbits are specified above
mocker.patch('RAiDER.s1_azimuth_timing.get_slc_id_from_point_and_time',
return_value=[
# Center_time
['reference_slc_id'], ['secondary_slc_id'],
# Azimuth time
['reference_slc_id'], ['secondary_slc_id'],
])
side_effect=[
# Azimuth time
['reference_slc_id'],
# using two "dummy" ids to mimic GUNW sec granules
# See docstring
['secondary_slc_id', 'secondary_slc_id'],
])

side_effect = (weather_model_dict_for_center_time_test[weather_model_name] +
weather_model_dict_for_azimuth_time_test[weather_model_name])
Expand All @@ -246,7 +245,9 @@ def test_azimuth_timing_against_interpolation(weather_model_name: str,
# Calls 6 times for azimuth time and 4 times for center time
assert RAiDER.processWM.prepareWeatherModel.call_count == 10
# Only calls for azimuth timing for reference and secondary
assert hyp3lib.get_orb.downloadSentinelOrbitFile.call_count == 4
assert hyp3lib.get_orb.downloadSentinelOrbitFile.call_count == 3
# Only calls for azimuth timing: once for ref and sec
assert RAiDER.s1_azimuth_timing.get_slc_id_from_point_and_time.call_count == 2
# Once for center-time and azimuth-time each
assert eof.download.download_eofs.call_count == 2

Expand Down

0 comments on commit c473b10

Please sign in to comment.