Esempio n. 1
0
 def test1(self):
     r = Read(10, 50, [(0,10),(1,5),(0,10),(2,10),(0,10)])
     self.assertRaisesRegexp(ValueError, 'underflows', annot.getReadOffset, r, 1)
     self.assertEquals(annot.getReadOffset(r, 10), 0)
     self.assertEquals(annot.getReadOffset(r, 19), 9)
     self.assertEquals(annot.getReadOffset(r, 20), 15)
     self.assertEquals(annot.getReadOffset(r, 29), 24)
     self.assertRaisesRegexp(ValueError, 'deletion', annot.getReadOffset, r, 30)
     self.assertRaisesRegexp(ValueError, 'deletion', annot.getReadOffset, r, 39)
     self.assertEquals(annot.getReadOffset(r, 40), 25)
     self.assertEquals(annot.getReadOffset(r, 49), 34)
     self.assertRaisesRegexp(ValueError, 'overflows', annot.getReadOffset, r, 50)
Esempio n. 2
0
 def test2(self):
     # qlen is set wrongly on purpose
     r = Read(10, 50, [(0,10),(1,5),(0,10),(2,10),(0,10)], 30)  
     self.assertRaisesRegexp(ValueError, 'underflows', annot.getReadOffset, r, 1)
     self.assertEquals(annot.getReadOffset(r, 10), 0)
     self.assertEquals(annot.getReadOffset(r, 19), 9)
     self.assertEquals(annot.getReadOffset(r, 20), 15)
     self.assertEquals(annot.getReadOffset(r, 29), 24)
     self.assertRaisesRegexp(ValueError, 'deletion', annot.getReadOffset, r, 30)
     self.assertRaisesRegexp(ValueError, 'deletion', annot.getReadOffset, r, 39)
     self.assertEquals(annot.getReadOffset(r, 40), 25)
     self.assertEquals(annot.getReadOffset(r, 44), 29)
     self.assertRaisesRegexp(ValueError, 'conflict', annot.getReadOffset, r, 45)
     self.assertRaisesRegexp(ValueError, 'conflict', annot.getReadOffset, r, 49)
     self.assertRaisesRegexp(ValueError, 'conflict', annot.getReadOffset, r, 50)                
Esempio n. 3
0
 def test1(self):
     r = Read(10, 50, [(0, 10), (1, 5), (0, 10), (2, 10), (0, 10)])
     self.assertRaisesRegexp(ValueError, 'underflows', annot.getReadOffset,
                             r, 1)
     self.assertEquals(annot.getReadOffset(r, 10), 0)
     self.assertEquals(annot.getReadOffset(r, 19), 9)
     self.assertEquals(annot.getReadOffset(r, 20), 15)
     self.assertEquals(annot.getReadOffset(r, 29), 24)
     self.assertRaisesRegexp(ValueError, 'deletion', annot.getReadOffset, r,
                             30)
     self.assertRaisesRegexp(ValueError, 'deletion', annot.getReadOffset, r,
                             39)
     self.assertEquals(annot.getReadOffset(r, 40), 25)
     self.assertEquals(annot.getReadOffset(r, 49), 34)
     self.assertRaisesRegexp(ValueError, 'overflows', annot.getReadOffset,
                             r, 50)
Esempio n. 4
0
 def test2(self):
     # qlen is set wrongly on purpose
     r = Read(10, 50, [(0, 10), (1, 5), (0, 10), (2, 10), (0, 10)], 30)
     self.assertRaisesRegexp(ValueError, 'underflows', annot.getReadOffset,
                             r, 1)
     self.assertEquals(annot.getReadOffset(r, 10), 0)
     self.assertEquals(annot.getReadOffset(r, 19), 9)
     self.assertEquals(annot.getReadOffset(r, 20), 15)
     self.assertEquals(annot.getReadOffset(r, 29), 24)
     self.assertRaisesRegexp(ValueError, 'deletion', annot.getReadOffset, r,
                             30)
     self.assertRaisesRegexp(ValueError, 'deletion', annot.getReadOffset, r,
                             39)
     self.assertEquals(annot.getReadOffset(r, 40), 25)
     self.assertEquals(annot.getReadOffset(r, 44), 29)
     self.assertRaisesRegexp(ValueError, 'conflict', annot.getReadOffset, r,
                             45)
     self.assertRaisesRegexp(ValueError, 'conflict', annot.getReadOffset, r,
                             49)
     self.assertRaisesRegexp(ValueError, 'conflict', annot.getReadOffset, r,
                             50)