1- from unittest import TestCase , main
21from collections import UserDict
32from pathlib import Path
3+ from unittest import TestCase , main
44
5- from zenlib .util import contains , unset
65from zenlib .logging import loggify
6+ from zenlib .util import contains , unset
77
8-
9- TEST_DICT = {'a' : [1 , 2 , 3 ],
10- 'b' : 123 ,
11- 'c' : '123' ,
12- 'd' : {'aa' : 1 , 'bb' : 2 },
13- 'e' : None ,
14- 'p' : Path (),
15- 'q' : Path ('test' )}
8+ TEST_DICT = {"a" : [1 , 2 , 3 ],
9+ "b" : 123 ,
10+ "c" : "123" ,
11+ "d" : {"aa" : 1 , "bb" : 2 },
12+ "e" : None ,
13+ "p" : Path (),
14+ "q" : Path ("test" )}
1615
1716
1817@loggify
@@ -21,47 +20,47 @@ def __init__(self, *args, **kwargs):
2120 super ().__init__ (* args , ** kwargs )
2221 self .data = TEST_DICT
2322
24- @contains ('a' )
23+ @contains ("a" )
2524 def _contains_a (self ):
2625 return True
2726
28- @contains ('e' )
27+ @contains ("e" )
2928 def _contains_e (self ):
30- assert False , ' This check should not pass'
29+ assert False , " This check should not pass"
3130
32- @contains ('e' , is_set = False )
31+ @contains ("e" , is_set = False )
3332 def _contains_e_unset (self ):
3433 return True
3534
36- @contains ('p' )
35+ @contains ("p" )
3736 def _contains_p (self ):
38- assert False , ' This check should not pass'
37+ assert False , " This check should not pass"
3938
40- @contains ('p' , is_set = False )
39+ @contains ("p" , is_set = False )
4140 def _contains_p_unset (self ):
4241 return True
4342
44- @contains ('q' )
43+ @contains ("q" )
4544 def _contains_q (self ):
4645 return True
4746
48- @contains ('z' )
47+ @contains ("z" )
4948 def _contains_z (self ):
50- assert False , ' This check should not pass'
49+ assert False , " This check should not pass"
5150
52- @unset ('a' )
51+ @unset ("a" )
5352 def _unset_a (self ):
54- assert False , ' This check should not pass'
53+ assert False , " This check should not pass"
5554
56- @unset ('a' , raise_exception = True )
55+ @unset ("a" , raise_exception = True )
5756 def _unset_a_exception (self ):
58- assert False , ' This check should not pass'
57+ assert False , " This check should not pass"
5958
60- @unset ('e' )
59+ @unset ("e" )
6160 def _unset_e (self ):
6261 return True
6362
64- @unset ('z' )
63+ @unset ("z" )
6564 def _unset_z (self ):
6665 return True
6766
@@ -86,6 +85,5 @@ def test_unset(self):
8685 self .assertTrue (test_dict ._unset_e ())
8786
8887
89- if __name__ == ' __main__' :
88+ if __name__ == " __main__" :
9089 main ()
91-
0 commit comments