def testNoCoverage(self): """ If a scanned read has no landmarks or trig points, its coveredIndices method must return the empty set. """ read = ScannedRead(AARead('id', 'AAA')) self.assertEqual(set(), read.coveredIndices())
def testCoverageOfOneLandmarkPoint(self): """ If a scanned read has one landmark, its coveredIndices method must return the indices of that landmark. """ read = ScannedRead(AARead('id', 'AAA')) landmark = Landmark('name', 'symbol', 0, 2) read.landmarks.append(landmark) self.assertEqual({0, 1}, read.coveredIndices())
def testCoverageOfOneTrigPoint(self): """ If a scanned read has one trig point, its coveredIndices method must return the index of that trig point. """ read = ScannedRead(AARead('id', 'AAA')) trigPoint = TrigPoint('name', 'symbol', 0) read.trigPoints.append(trigPoint) self.assertEqual({0}, read.coveredIndices())
def testCoverageOfTwoIdenticalTrigPoints(self): """ If a scanned read has two trig points that occur at the same index, its coveredIndices method must return the common index of the trig point. """ read = ScannedRead(AARead('id', 'AAA')) trigPoint = TrigPoint('name', 'symbol', 0) read.trigPoints.append(trigPoint) trigPoint = TrigPoint('name', 'symbol', 0) read.trigPoints.append(trigPoint) self.assertEqual({0}, read.coveredIndices())
def testCoverageOfTwoTrigPoints(self): """ If a scanned read has two trig points, its coveredIndices method must return the indices of those trig points. """ read = ScannedRead(AARead('id', 'AAA')) trigPoint = TrigPoint('name', 'symbol', 0) read.trigPoints.append(trigPoint) trigPoint = TrigPoint('name', 'symbol', 1) read.trigPoints.append(trigPoint) self.assertEqual({0, 1}, read.coveredIndices())
def testCoverageOfTwoDifferentOverlappingLandmarkPoints(self): """ If a scanned read has two landmarks, its coveredIndices method must return the indices of those two landmarks. """ read = ScannedRead(AARead('id', 'AAAAA')) landmark = Landmark('name', 'symbol1', 0, 5) read.landmarks.append(landmark) landmark = Landmark('name', 'symbol2', 4, 2) read.landmarks.append(landmark) self.assertEqual({0, 1, 2, 3, 4, 5}, read.coveredIndices())