From 0374d7cf84ecd8182b74a639fcfdb9eafddcfd15 Mon Sep 17 00:00:00 2001 From: Konrad Weihmann Date: Fri, 10 Jul 2020 18:41:02 +0200 Subject: tests: move to root dir This should ensure that tests are NOT packaged into release package by setuptools, as tests are development only + fixtures after moving Signed-off-by: Konrad Weihmann --- test/test_exc.py | 169 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 test/test_exc.py (limited to 'test/test_exc.py') diff --git a/test/test_exc.py b/test/test_exc.py new file mode 100644 index 00000000..f16498ab --- /dev/null +++ b/test/test_exc.py @@ -0,0 +1,169 @@ +# -*- 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 test.lib import TestBase + +import itertools as itt + + +_cmd_argvs = ( + ('cmd', ), + ('θνιψοδε', ), + ('θνιψοδε', 'normal', 'argvs'), + ('cmd', 'ελληνικα', 'args'), + ('θνιψοδε', 'κι', 'αλλα', 'strange', 'args'), + ('θνιψοδε', 'κι', 'αλλα', 'non-unicode', 'args'), +) +_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(), "