@@ -96,16 +96,16 @@ def test_basic(self):
96
96
eq (cf .get ('Spaces' , 'key with spaces' ), 'value' )
97
97
eq (cf .get ('Spaces' , 'another with spaces' ), 'splat!' )
98
98
99
- self .failIf ('__name__' in cf .options ("Foo Bar" ),
99
+ self .assertFalse ('__name__' in cf .options ("Foo Bar" ),
100
100
'__name__ "option" should not be exposed by the API!' )
101
101
102
102
# Make sure the right things happen for remove_option();
103
103
# added to include check for SourceForge bug #123324:
104
- self .failUnless (cf .remove_option ('Foo Bar' , 'foo' ),
104
+ self .assertTrue (cf .remove_option ('Foo Bar' , 'foo' ),
105
105
"remove_option() failed to report existance of option" )
106
- self .failIf (cf .has_option ('Foo Bar' , 'foo' ),
106
+ self .assertFalse (cf .has_option ('Foo Bar' , 'foo' ),
107
107
"remove_option() failed to remove option" )
108
- self .failIf (cf .remove_option ('Foo Bar' , 'foo' ),
108
+ self .assertFalse (cf .remove_option ('Foo Bar' , 'foo' ),
109
109
"remove_option() failed to report non-existance of option"
110
110
" that was removed" )
111
111
@@ -127,10 +127,10 @@ def test_case_sensitivity(self):
127
127
eq (cf .options ("a" ), ["b" ])
128
128
eq (cf .get ("a" , "b" ), "value" ,
129
129
"could not locate option, expecting case-insensitive option names" )
130
- self .failUnless (cf .has_option ("a" , "b" ))
130
+ self .assertTrue (cf .has_option ("a" , "b" ))
131
131
cf .set ("A" , "A-B" , "A-B value" )
132
132
for opt in ("a-b" , "A-b" , "a-B" , "A-B" ):
133
- self .failUnless (
133
+ self .assertTrue (
134
134
cf .has_option ("A" , opt ),
135
135
"has_option() returned false for option which should exist" )
136
136
eq (cf .options ("A" ), ["a-b" ])
@@ -147,7 +147,7 @@ def test_case_sensitivity(self):
147
147
# SF bug #561822:
148
148
cf = self .fromstring ("[section]\n nekey=nevalue\n " ,
149
149
defaults = {"key" :"value" })
150
- self .failUnless (cf .has_option ("section" , "Key" ))
150
+ self .assertTrue (cf .has_option ("section" , "Key" ))
151
151
152
152
def test_default_case_sensitivity (self ):
153
153
cf = self .newconfig ({"foo" : "Bar" })
@@ -182,7 +182,7 @@ def test_query_errors(self):
182
182
cf = self .newconfig ()
183
183
self .assertEqual (cf .sections (), [],
184
184
"new ConfigParser should have no defined sections" )
185
- self .failIf (cf .has_section ("Foo" ),
185
+ self .assertFalse (cf .has_section ("Foo" ),
186
186
"new ConfigParser should have no acknowledged sections" )
187
187
self .assertRaises (ConfigParser .NoSectionError ,
188
188
cf .options , "Foo" )
@@ -221,8 +221,8 @@ def test_boolean(self):
221
221
"E5=FALSE AND MORE"
222
222
)
223
223
for x in range (1 , 5 ):
224
- self .failUnless (cf .getboolean ('BOOLTEST' , 't%d' % x ))
225
- self .failIf (cf .getboolean ('BOOLTEST' , 'f%d' % x ))
224
+ self .assertTrue (cf .getboolean ('BOOLTEST' , 't%d' % x ))
225
+ self .assertFalse (cf .getboolean ('BOOLTEST' , 'f%d' % x ))
226
226
self .assertRaises (ValueError ,
227
227
cf .getboolean , 'BOOLTEST' , 'e%d' % x )
228
228
0 commit comments