# -*- coding: utf-8 -*- # test_exc.py # Copyright (C) 2008, 2009, 2016 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php import re import ddt from git.exc import ( InvalidGitRepositoryError, WorkTreeRepositoryUnsupported, NoSuchPathError, CommandError, GitCommandNotFound, GitCommandError, CheckoutError, CacheError, UnmergedEntriesError, HookExecutionError, RepositoryDirtyError, ) from git.util import remove_password_if_present from test.lib import TestBase import itertools as itt _cmd_argvs = ( ("cmd",), ("θνιψοδε",), ("θνιψοδε", "normal", "argvs"), ("cmd", "ελληνικα", "args"), ("θνιψοδε", "κι", "αλλα", "strange", "args"), ("θνιψοδε", "κι", "αλλα", "non-unicode", "args"), ( "git", "clone", "-v", "https://fakeuser:fakepassword1234@fakerepo.example.com/testrepo", ), ) _causes_n_substrings = ( (None, None), # noqa: E241 @IgnorePep8 (7, "exit code(7)"), # noqa: E241 @IgnorePep8 ("Some string", "'Some string'"), # noqa: E241 @IgnorePep8 ("παλιο string", "'παλιο string'"), # noqa: E241 @IgnorePep8 (Exception("An exc."), "Exception('An exc.')"), # noqa: E241 @IgnorePep8 (Exception("Κακια exc."), "Exception('Κακια exc.')"), # noqa: E241 @IgnorePep8 (object(), "