@@ -555,6 +555,24 @@ def test_insert(self):
555555 datetime .datetime (2011 , 12 , 1 , 12 , 0 , 2 ),
556556 datetime .datetime (2011 , 12 , 1 , 12 , 0 , 3 ),
557557 datetime .datetime (2011 , 12 , 1 , 12 , 0 , 4 )])
558+
559+ prop10 = Property (name = "prop" , value = ["Earth is\n No. 3." ], dtype = DType .text )
560+ prop10 .insert (1 , "Mars is\n No. 4." , strict = False )
561+ self .assertEqual (len (prop10 ), 2 )
562+ self .assertEqual (prop10 .values , ["Earth is\n No. 3." , "Mars is\n No. 4." ])
563+ prop10 .insert (1 , 'A new world emerged?' , strict = True )
564+ self .assertEqual (prop10 .values , ["Earth is\n No. 3." ,
565+ "A new world emerged?" ,
566+ "Mars is\n No. 4." ])
567+ prop10 .insert (1 , 1 , strict = False )
568+ self .assertEqual (prop10 .values , ["Earth is\n No. 3." , "1" ,
569+ "A new world emerged?" ,
570+ "Mars is\n No. 4." ])
571+ with self .assertRaises (ValueError ):
572+ prop10 .insert (1 , 1 , strict = True )
573+ self .assertEqual (prop10 .values , ["Earth is\n No. 3." , "1" ,
574+ "A new world emerged?" ,
575+ "Mars is\n No. 4." ])
558576
559577 def test_reorder (self ):
560578 sec = Section ()
0 commit comments