diff options
Diffstat (limited to 'git/test/test_exc.py')
-rw-r--r-- | git/test/test_exc.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/git/test/test_exc.py b/git/test/test_exc.py index 33f44034..28d824d0 100644 --- a/git/test/test_exc.py +++ b/git/test/test_exc.py @@ -10,10 +10,17 @@ import re import ddt from git.exc import ( + InvalidGitRepositoryError, + WorkTreeRepositoryUnsupported, + NoSuchPathError, CommandError, GitCommandNotFound, GitCommandError, + CheckoutError, + CacheError, + UnmergedEntriesError, HookExecutionError, + RepositoryDirtyError, ) from git.test.lib import TestBase @@ -44,6 +51,26 @@ _streams_n_substrings = (None, 'steram', 'ομορφο stream', ) @ddt.ddt class TExc(TestBase): + def test_ExceptionsHaveBaseClass(self): + from git.exc import GitError + self.assertIsInstance(GitError(), Exception) + + exception_classes = [ + InvalidGitRepositoryError, + WorkTreeRepositoryUnsupported, + NoSuchPathError, + CommandError, + GitCommandNotFound, + GitCommandError, + CheckoutError, + CacheError, + UnmergedEntriesError, + HookExecutionError, + RepositoryDirtyError, + ] + for ex_class in exception_classes: + self.assertTrue(issubclass(ex_class, GitError)) + @ddt.data(*list(itt.product(_cmd_argvs, _causes_n_substrings, _streams_n_substrings))) def test_CommandError_unicode(self, case): argv, (cause, subs), stream = case |