File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,3 +76,24 @@ def run_func_async(func):
7676 print (e )
7777
7878 raise AssertionError (exception_list )
79+
80+ def test_partial_exception (self ):
81+ class TestDownloader (JmDownloader ):
82+ @catch_exception
83+ def download_by_image_detail (self , image : JmImageDetail ):
84+ raise Exception ('test_partial_exception' )
85+
86+ @catch_exception
87+ def download_by_photo_detail (self , photo : JmPhotoDetail ):
88+ if photo .index != 2 :
89+ raise Exception ('test_partial_exception' )
90+ return super ().download_by_photo_detail (photo )
91+
92+ self .assertRaises (
93+ PartialDownloadFailedException ,
94+ lambda : download_album (182150 , downloader = TestDownloader , check_exception = True )
95+ )
96+ self .assertRaises (
97+ PartialDownloadFailedException ,
98+ lambda : download_photo (182151 , downloader = TestDownloader , check_exception = True )
99+ )
You can’t perform that action at this time.
0 commit comments