Skip to content

Commit

Permalink
bigger test
Browse files Browse the repository at this point in the history
  • Loading branch information
burnout87 committed Feb 7, 2025
1 parent 9ff91e3 commit 7ad9d25
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/test_drupal.py
Original file line number Diff line number Diff line change
Expand Up @@ -938,20 +938,25 @@ def test_product_gallery_get_product_with_conditions_long_time_range(dispatcher_


@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):
@pytest.mark.parametrize("span_rev", [[100, 2500], [None, 50], [50, None], [None, None]])
def test_product_gallery_get_product_with_conditions_long_time_range_rev_range(dispatcher_api_with_gallery, span_rev):
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 944 in tests/test_drupal.py

View check run for this annotation

Codecov / codecov/patch

tests/test_drupal.py#L943-L944

Added lines #L943 - L944 were not covered by tests
instrument="isgri",
min_span_rev=100,
max_span_rev=2500
min_span_rev=span_rev[0],
max_span_rev=span_rev[1]
)

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

Check warning on line 951 in tests/test_drupal.py

View check run for this annotation

Codecov / codecov/patch

tests/test_drupal.py#L950-L951

Added lines #L950 - L951 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
if span_rev[0] is None:
span_rev[0] = 0
if span_rev[1] is None:
span_rev[1] = 3000
assert span_rev[0] <= (float(image['rev2']) - float(image['rev1'])) <= span_rev[1]

Check warning on line 959 in tests/test_drupal.py

View check run for this annotation

Codecov / codecov/patch

tests/test_drupal.py#L954-L959

Added lines #L954 - L959 were not covered by tests


@pytest.mark.test_drupal
Expand Down

0 comments on commit 7ad9d25

Please sign in to comment.