sentinelhub.testing_utils

Utility tools for writing unit tests for packages which rely on sentinelhub-py

sentinelhub.testing_utils.get_input_folder(current_file)[source]

Use fixtures if possible. This is meant only for test cases

Parameters:

current_file (str) –

Return type:

str

sentinelhub.testing_utils.get_output_folder(current_file)[source]

Use fixtures if possible. This is meant only for test cases

Parameters:

current_file (str) –

Return type:

str

sentinelhub.testing_utils.assert_statistics_match(data, exp_shape=None, exp_dtype=None, exp_min=None, exp_max=None, exp_mean=None, exp_median=None, exp_std=None, rel_delta=None, abs_delta=None)[source]

Validates basic statistics of data array :param data: Data array :param exp_shape: Expected shape :param exp_dtype: Expected dtype :param exp_min: Expected minimal value :param exp_max: Expected maximal value :param exp_mean: Expected mean value :param exp_median: Expected median value :param exp_std: Expected standard deviation value :param rel_delta: Precision of validation (relative) :param abs_delta: Precision of validation (absolute)

Parameters:
  • data (ndarray) –

  • exp_shape (tuple[int, ...] | None) –

  • exp_dtype (None | type | dtype) –

  • exp_min (float | None) –

  • exp_max (float | None) –

  • exp_mean (float | None) –

  • exp_median (float | None) –

  • exp_std (float | None) –

  • rel_delta (float | None) –

  • abs_delta (float | None) –

Return type:

None