def testNormalize(self): simpleRange = FrameRange('3-5') simpleRange.normalize() self.assertEqual([3, 4, 5], simpleRange.getAll()) reverseOrder = FrameRange('3-1x-1') reverseOrder.normalize() self.assertEqual([1, 2, 3], reverseOrder.getAll())
def testNegativeInterleave(self): result = FrameRange('10-1:-5') self.assertEqual([10, 5, 9, 7, 3, 1, 8, 6, 4, 2], result.getAll())
def testInterleave(self): result = FrameRange('1-10:5') self.assertEqual([1, 6, 2, 4, 8, 10, 3, 5, 7, 9], result.getAll())
def testNegativeInvertedStep(self): result = FrameRange('8-1y-2') self.assertEqual([7, 5, 3, 1], result.getAll())
def testInvertedStep(self): result = FrameRange('1-8y2') self.assertEqual([2, 4, 6, 8], result.getAll())
def testNegativeStep(self): result = FrameRange('8-1x-2') self.assertEqual([8, 6, 4, 2], result.getAll())
def testStep(self): result = FrameRange('1-8x2') self.assertEqual([1, 3, 5, 7], result.getAll())
def testReverseNegativeFrameRange(self): result = FrameRange('-2--6') self.assertEqual([-2, -3, -4, -5, -6], result.getAll())
def testReverseFrameRange(self): result = FrameRange('6-2') self.assertEqual([6, 5, 4, 3, 2], result.getAll())
def testNegativeToPositiveFrameRange(self): result = FrameRange('-5-3') self.assertEqual([-5, -4, -3, -2, -1, 0, 1, 2, 3], result.getAll())
def testNegativeFrameRange(self): result = FrameRange('-20--13') self.assertEqual([-20, -19, -18, -17, -16, -15, -14, -13], result.getAll())
def testFrameRange(self): result = FrameRange('1-7') self.assertEqual([1, 2, 3, 4, 5, 6, 7], result.getAll())
def testNegativeSingleFrame(self): frame = -4982 result = FrameRange(str(frame)) self.assertEqual([frame], result.getAll())
def testSingleFrame(self): frame = 4927 result = FrameRange(str(frame)) self.assertEqual([frame], result.getAll())