Skip to content

Commit

Permalink
dev(narugo): add unittest for webp datasets
Browse files Browse the repository at this point in the history
narugo1992 committed Oct 2, 2024
1 parent 519dd30 commit 9020fb5
Showing 6 changed files with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions test/datapool/test_e621.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
from hbutils.testing import isolated_directory

from cheesechaser.datapool import E621NewestDataPool
from cheesechaser.datapool import E621NewestDataPool, E621NewestWebpDataPool
from ..testings import get_testfile, dir_compare


@@ -18,13 +18,14 @@ def test_e621_origin(self):

dir_compare('.', get_testfile('e621_5'))

# def test_download_webp(self):
# with isolated_directory():
# pool = E621NewestWebpDataPool()
# # 120 not exist
# pool.batch_download_to_directory(
# resource_ids=[120, 175, 5000000, 7000000, 7600000, 7800000],
# dst_dir='.',
# )
#
# dir_compare('.', get_testfile('e621_webp_5'))
def test_download_webp(self):
with isolated_directory():
pool = E621NewestWebpDataPool()
# 69 not exist
# 97 if a gif image
pool.batch_download_to_directory(
resource_ids=[68, 69, 93, 97, 5080080, 5080082, 5080086],
dst_dir='.',
)

dir_compare('.', get_testfile('e621_webp_5'))
Binary file added test/testfile/e621_webp_5/5080080.webp
Binary file not shown.
Binary file added test/testfile/e621_webp_5/5080082.webp
Binary file not shown.
Binary file added test/testfile/e621_webp_5/5080086.webp
Binary file not shown.
Binary file added test/testfile/e621_webp_5/68.webp
Binary file not shown.
Binary file added test/testfile/e621_webp_5/93.webp
Binary file not shown.

0 comments on commit 9020fb5

Please sign in to comment.