5
5
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
6
6
7
7
import re
8
- import stat
9
8
from unittest .mock import patch
10
9
11
10
from nose .tools import (
17
16
assert_false # @UnusedImport
18
17
)
19
18
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' ,
24
20
'assert_equal' , 'assert_not_equal' , 'assert_raises' , 'patch' , 'raises' ,
25
21
'assert_true' , 'assert_false' ]
26
22
27
23
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
-
43
24
def assert_not_none (actual , msg = None ):
44
25
"""verify that item is None"""
45
26
assert actual is not None , msg
@@ -48,20 +29,3 @@ def assert_not_none(actual, msg=None):
48
29
def assert_match (pattern , string , msg = None ):
49
30
"""verify that the pattern matches the string"""
50
31
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