File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed
Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,13 @@ class InvalidDirectoryError(Error):
3030 pass
3131
3232
33- class FileNotFoundError (Error ):
33+ class FileNotFoundError (Error , FileNotFoundError ):
3434 pass
3535
3636
37- class NotADirectoryError (Error ):
37+ class IsADirectoryError (Error , IsADirectoryError ):
38+ pass
39+
40+
41+ class NotADirectoryError (Error , NotADirectoryError ):
3842 pass
Original file line number Diff line number Diff line change 1+ import pytest
2+
3+ from dissect .fat import exceptions
4+
5+
6+ @pytest .mark .parametrize (
7+ "exc, std" ,
8+ [
9+ (exceptions .FileNotFoundError , FileNotFoundError ),
10+ (exceptions .IsADirectoryError , IsADirectoryError ),
11+ (exceptions .NotADirectoryError , NotADirectoryError ),
12+ ],
13+ )
14+ def test_filesystem_error_subclass (exc : exceptions .Error , std : Exception ) -> None :
15+ assert issubclass (exc , std )
16+ assert isinstance (exc (), std )
17+
18+ with pytest .raises (std ):
19+ raise exc ()
You can’t perform that action at this time.
0 commit comments