Skip to content

Commit 45a5495

Browse files
committed
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
1 parent 61fef99 commit 45a5495

File tree

1 file changed

+1
-37
lines changed

1 file changed

+1
-37
lines changed

git/test/lib/asserts.py

+1-37
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

77
import re
8-
import stat
98
from unittest.mock import patch
109

1110
from nose.tools import (
@@ -17,29 +16,11 @@
1716
assert_false # @UnusedImport
1817
)
1918

20-
__all__ = ['assert_instance_of', 'assert_not_instance_of',
21-
'assert_none', 'assert_not_none',
22-
'assert_match', 'assert_not_match', 'assert_mode_644',
23-
'assert_mode_755',
19+
__all__ = ['assert_not_none', 'assert_match',
2420
'assert_equal', 'assert_not_equal', 'assert_raises', 'patch', 'raises',
2521
'assert_true', 'assert_false']
2622

2723

28-
def assert_instance_of(expected, actual, msg=None):
29-
"""Verify that object is an instance of expected """
30-
assert isinstance(actual, expected), msg
31-
32-
33-
def assert_not_instance_of(expected, actual, msg=None):
34-
"""Verify that object is not an instance of expected """
35-
assert not isinstance(actual, expected, msg)
36-
37-
38-
def assert_none(actual, msg=None):
39-
"""verify that item is None"""
40-
assert actual is None, msg
41-
42-
4324
def assert_not_none(actual, msg=None):
4425
"""verify that item is None"""
4526
assert actual is not None, msg
@@ -48,20 +29,3 @@ def assert_not_none(actual, msg=None):
4829
def assert_match(pattern, string, msg=None):
4930
"""verify that the pattern matches the string"""
5031
assert_not_none(re.search(pattern, string), msg)
51-
52-
53-
def assert_not_match(pattern, string, msg=None):
54-
"""verify that the pattern does not match the string"""
55-
assert_none(re.search(pattern, string), msg)
56-
57-
58-
def assert_mode_644(mode):
59-
"""Verify given mode is 644"""
60-
assert (mode & stat.S_IROTH) and (mode & stat.S_IRGRP)
61-
assert (mode & stat.S_IWUSR) and (mode & stat.S_IRUSR) and not (mode & stat.S_IXUSR)
62-
63-
64-
def assert_mode_755(mode):
65-
"""Verify given mode is 755"""
66-
assert (mode & stat.S_IROTH) and (mode & stat.S_IRGRP) and (mode & stat.S_IXOTH) and (mode & stat.S_IXGRP)
67-
assert (mode & stat.S_IWUSR) and (mode & stat.S_IRUSR) and (mode & stat.S_IXUSR)

0 commit comments

Comments
 (0)