Пример #1
0
 def test_insert(self):
     xc = XigtCorpus()
     assert len(xc) == 0
     xc.insert(0, Igt(id='i1'))
     assert len(xc) == 1
     with pytest.raises(XigtError): xc.insert(0, Igt(id='i1'))
     xc.insert(0, Igt(id='i2'))
     xc.insert(100, Igt(id='i3'))
     assert len(xc) == 3
     assert xc[0].id == 'i2'
     assert xc[1].id == 'i1'
     assert xc[2].id == 'i3'
Пример #2
0
 def test_insert(self):
     xc = XigtCorpus()
     self.assertEqual(len(xc), 0)
     xc.insert(0, Igt(id='i1'))
     self.assertEqual(len(xc), 1)
     self.assertRaises(XigtError, xc.insert, 0, Igt(id='i1'))
     xc.insert(0, Igt(id='i2'))
     xc.insert(100, Igt(id='i3'))
     self.assertEqual(len(xc), 3)
     self.assertEqual(xc[0].id, 'i2')
     self.assertEqual(xc[1].id, 'i1')
     self.assertEqual(xc[2].id, 'i3')