@@ -84,12 +84,6 @@ def test_property_values_cardinality(self):
8484 self .assertFalse (err .is_error )
8585 self .assertIn (test_msg , err .msg )
8686
87- def test_section_type (self ):
88- doc = samplefile .parse ("""s1[undefined]""" )
89- res = validate (doc )
90- # the section type is undefined (also in the mapping)
91- self .assertError (res , "Section type undefined" )
92-
9387 def test_section_in_terminology (self ):
9488 doc = samplefile .parse ("""s1[T1]""" )
9589 res = validate (doc )
@@ -202,17 +196,12 @@ def test_property_name_readable(self):
202196 def test_standalone_section (self ):
203197 """
204198 Test if standalone section does not return errors if required attributes are correct.
205- If type is undefined , check error message.
199+ If type is not specified , check error message.
206200 """
207201
208202 sec_one = odml .Section ("sec1" )
209-
210203 res = validate (sec_one )
211- self .assertError (res , "Section type undefined" )
212-
213- doc = samplefile .parse ("""s1[undefined]""" )
214- res = validate (doc )
215- self .assertError (res , "Section type undefined" )
204+ self .assertError (res , "Section type not specified" )
216205
217206 def test_standalone_property (self ):
218207 """
@@ -229,14 +218,15 @@ def test_section_init(self):
229218 """
230219 Test validation errors printed to stdout on section init.
231220 """
232- val_errs = StringIO ()
221+ check_msg = "Missing required attribute 'type'"
233222
223+ val_errs = StringIO ()
234224 old_stdout = sys .stdout
235225 sys .stdout = val_errs
236226 odml .Section (name = "sec" , type = None )
237227 sys .stdout = old_stdout
238228
239- self .assertIn ("Section type undefined" , val_errs .getvalue ())
229+ self .assertIn (check_msg , val_errs .getvalue ())
240230
241231 def test_prop_string_values (self ):
242232 """
@@ -246,7 +236,7 @@ def test_prop_string_values(self):
246236
247237 prop0 = odml .Property (name = 'words' , dtype = "string" ,
248238 values = ['-13' , '101' , '-11' , 'hello' ])
249- assert len (validate (prop0 ).errors ) == 0
239+ self . assertEquals ( len (validate (prop0 ).errors ), 0 )
250240
251241 msg_base = 'Dtype of property "%s" currently is "string", but might fit dtype "%s"!'
252242
0 commit comments