diff options
author | Harmon <Harmon758@gmail.com> | 2020-02-16 15:20:02 -0600 |
---|---|---|
committer | Harmon <Harmon758@gmail.com> | 2020-02-16 15:22:28 -0600 |
commit | 45a5495966c08bb8a269783fd8fa2e1c17d97d6d (patch) | |
tree | 779d0a76799c5a0b3cc5b5cff3684560ebf34ff7 /git/test/lib/asserts.py | |
parent | 61fef99bd2ece28b0f2dd282843239ac8db893ed (diff) | |
download | gitpython-45a5495966c08bb8a269783fd8fa2e1c17d97d6d.tar.gz |
Remove old, no longer used assert methods
assert_instance_of, assert_not_instance_of, assert_none, assert_not_match, assert_mode_644, assert_mode_755
Diffstat (limited to 'git/test/lib/asserts.py')
-rw-r--r-- | git/test/lib/asserts.py | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/git/test/lib/asserts.py b/git/test/lib/asserts.py index 92f95418..a520b1ea 100644 --- a/git/test/lib/asserts.py +++ b/git/test/lib/asserts.py @@ -5,7 +5,6 @@ # the BSD License: http://www.opensource.org/licenses/bsd-license.php import re -import stat from unittest.mock import patch from nose.tools import ( @@ -17,29 +16,11 @@ from nose.tools import ( assert_false # @UnusedImport ) -__all__ = ['assert_instance_of', 'assert_not_instance_of', - 'assert_none', 'assert_not_none', - 'assert_match', 'assert_not_match', 'assert_mode_644', - 'assert_mode_755', +__all__ = ['assert_not_none', 'assert_match', 'assert_equal', 'assert_not_equal', 'assert_raises', 'patch', 'raises', 'assert_true', 'assert_false'] -def assert_instance_of(expected, actual, msg=None): - """Verify that object is an instance of expected """ - assert isinstance(actual, expected), msg - - -def assert_not_instance_of(expected, actual, msg=None): - """Verify that object is not an instance of expected """ - assert not isinstance(actual, expected, msg) - - -def assert_none(actual, msg=None): - """verify that item is None""" - assert actual is None, msg - - def assert_not_none(actual, msg=None): """verify that item is None""" assert actual is not None, msg @@ -48,20 +29,3 @@ def assert_not_none(actual, msg=None): def assert_match(pattern, string, msg=None): """verify that the pattern matches the string""" assert_not_none(re.search(pattern, string), msg) - - -def assert_not_match(pattern, string, msg=None): - """verify that the pattern does not match the string""" - assert_none(re.search(pattern, string), msg) - - -def assert_mode_644(mode): - """Verify given mode is 644""" - assert (mode & stat.S_IROTH) and (mode & stat.S_IRGRP) - assert (mode & stat.S_IWUSR) and (mode & stat.S_IRUSR) and not (mode & stat.S_IXUSR) - - -def assert_mode_755(mode): - """Verify given mode is 755""" - assert (mode & stat.S_IROTH) and (mode & stat.S_IRGRP) and (mode & stat.S_IXOTH) and (mode & stat.S_IXGRP) - assert (mode & stat.S_IWUSR) and (mode & stat.S_IRUSR) and (mode & stat.S_IXUSR) |