55# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66
77import re
8- import stat
98from unittest .mock import patch
109
1110from nose .tools import (
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-
4324def 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):
4829def 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