Skip to content

Commit

Permalink
dedicated test
Browse files Browse the repository at this point in the history
  • Loading branch information
burnout87 committed Feb 7, 2025
1 parent f662809 commit 9ff91e3
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions tests/test_drupal.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,14 +906,17 @@ def test_product_gallery_get_product_with_conditions_long_time_range(dispatcher_
if product_type == 'spectrum':
spectra_list = disp.get_list_spectra_with_conditions(t1='2003-01-01T00:00:00', t2='2024-08-24T23:59:59',

Check warning on line 907 in tests/test_drupal.py

View check run for this annotation

Codecov / codecov/patch

tests/test_drupal.py#L905-L907

Added lines #L905 - L907 were not covered by tests
instrument="isgri",
token=encoded_token)
token=encoded_token,
max_span_rev=0)
assert isinstance(spectra_list, list)
print(f"spectra_list has {len(spectra_list)} products")

Check warning on line 912 in tests/test_drupal.py

View check run for this annotation

Codecov / codecov/patch

tests/test_drupal.py#L911-L912

Added lines #L911 - L912 were not covered by tests

elif product_type == 'image':
images_list = disp.get_list_images_with_conditions(t1='2003-01-01T00:00:00', t2='2024-08-24T23:59:59',

Check warning on line 915 in tests/test_drupal.py

View check run for this annotation

Codecov / codecov/patch

tests/test_drupal.py#L914-L915

Added lines #L914 - L915 were not covered by tests
instrument="isgri",
token=encoded_token)
token=encoded_token,
max_span_rev=0
)

assert isinstance(images_list, list)
print(f"images_list has {len(images_list)} products")
Expand All @@ -928,11 +931,29 @@ def test_product_gallery_get_product_with_conditions_long_time_range(dispatcher_
elif product_type == 'lightcurve':
lightcurves_list = disp.get_list_lightcurve_with_conditions(t1='2003-01-01T00:00:00', t2='2024-08-24T23:59:59',

Check warning on line 932 in tests/test_drupal.py

View check run for this annotation

Codecov / codecov/patch

tests/test_drupal.py#L931-L932

Added lines #L931 - L932 were not covered by tests
instrument="isgri",
token=encoded_token)
token=encoded_token,
max_span_rev=0)
assert isinstance(lightcurves_list, list)
print(f"lightcurves_list has {len(lightcurves_list)} products")

Check warning on line 937 in tests/test_drupal.py

View check run for this annotation

Codecov / codecov/patch

tests/test_drupal.py#L936-L937

Added lines #L936 - L937 were not covered by tests


@pytest.mark.test_drupal
def test_product_gallery_get_product_with_conditions_long_time_range_rev_range(dispatcher_api_with_gallery, dispatcher_test_conf_with_gallery):
disp = dispatcher_api_with_gallery
images_list = disp.get_list_images_with_conditions(t1='2003-01-01T00:00:00', t2='2024-08-24T23:59:59',

Check warning on line 943 in tests/test_drupal.py

View check run for this annotation

Codecov / codecov/patch

tests/test_drupal.py#L942-L943

Added lines #L942 - L943 were not covered by tests
instrument="isgri",
min_span_rev=100,
max_span_rev=2500
)

assert isinstance(images_list, list)
print(f"images_list has {len(images_list)} products")

Check warning on line 950 in tests/test_drupal.py

View check run for this annotation

Codecov / codecov/patch

tests/test_drupal.py#L949-L950

Added lines #L949 - L950 were not covered by tests

# test the span rev is actually >= 100 and <= 2500
for image in images_list:
assert 100 <= (float(image['rev2']) - float(image['rev1'])) <= 2500

Check warning on line 954 in tests/test_drupal.py

View check run for this annotation

Codecov / codecov/patch

tests/test_drupal.py#L953-L954

Added lines #L953 - L954 were not covered by tests


@pytest.mark.test_drupal
@pytest.mark.parametrize("source_name", ["new", "known"])
def test_product_gallery_get_product_list_by_source_name(dispatcher_api_with_gallery, dispatcher_test_conf_with_gallery, source_name):
Expand Down

0 comments on commit 9ff91e3

Please sign in to comment.