diff options
author | Konstantin Popov <konstantin.popov.89@yandex.ru> | 2017-04-17 14:07:11 +0300 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2017-05-29 05:53:20 +0200 |
commit | 0bbcf2fc648561e4fc90ee4cc5525a3257604ec1 (patch) | |
tree | 2e0a2f7abedf693553a59c3cd544a3ed8736889d /git/test/test_exc.py | |
parent | c121f60395ce47b2c0f9e26fbc5748b4bb27802d (diff) | |
download | gitpython-0bbcf2fc648561e4fc90ee4cc5525a3257604ec1.tar.gz |
Add base class for package exceptions.
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 |