Skip to content

Commit

Permalink
dev(narugo): add test limited
Browse files Browse the repository at this point in the history
  • Loading branch information
narugo1992 committed Sep 23, 2024
1 parent 3904dce commit 2c8555c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/pipe/test_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,16 @@ def test_actual_usage_with_100_images(self):
image_count += 1

assert image_count >= 90

def test_actual_usage_with_100_images_limited_20(self):
pool = DanbooruNewestWebpDataPool()
pipe = SimpleImagePipe(pool)

ids = range(7000000, 7700000, 7000)
with pipe.batch_retrieve(ids, max_count=20) as session:
image_count = 0
for item in session:
assert isinstance(item.data, Image.Image)
image_count += 1

assert image_count == 20

0 comments on commit 2c8555c

Please sign in to comment.