def test_pageUp_numChannels_gt_channelsPerPage(self): p = Pager(numChannels=18, channelsPerPage=8) for i in xrange(0, 8): self.assertEquals(16, p.pageUp(i)) for i in xrange(8, 16): self.assertEquals(0, p.pageUp(i)) for i in xrange(16, 19): self.assertEquals(8, p.pageUp(i))
def test_pageUp_numChannels_gt_channelsPerPage(self): p = Pager(numChannels=18, channelsPerPage=8) for i in xrange(0, 8): self.assertEquals(16, p.pageUp(i)) for i in xrange(8, 16): self.assertEquals(0, p.pageUp(i)) for i in xrange(16,19): self.assertEquals(8, p.pageUp(i))
def test_pageUp_numChannels_divisible_channelsPerPage(self): p = Pager(numChannels=24, channelsPerPage=8) for i in xrange(0, 8): self.assertEquals(16, p.pageUp(i)) for i in xrange(8, 16): self.assertEquals(0, p.pageUp(i), 'i=%d' % i) for i in xrange(16, 24): self.assertEquals(8, p.pageUp(i), 'i=%d' % i) p = Pager(numChannels=8, channelsPerPage=8) for i in xrange(0, 8): self.assertEquals(0, p.pageUp(i)) p = Pager(numChannels=16, channelsPerPage=8) for i in xrange(0, 8): self.assertEquals(8, p.pageUp(i)) for i in xrange(8, 16): self.assertEquals(0, p.pageUp(i))
def test_pageUp_numChannels_divisible_channelsPerPage(self): p = Pager(numChannels=24, channelsPerPage=8) for i in xrange(0, 8): self.assertEquals(16, p.pageUp(i)) for i in xrange(8, 16): self.assertEquals(0, p.pageUp(i), 'i=%d'%i) for i in xrange(16, 24): self.assertEquals(8, p.pageUp(i), 'i=%d'%i) p = Pager(numChannels=8, channelsPerPage=8) for i in xrange(0, 8): self.assertEquals(0, p.pageUp(i)) p = Pager(numChannels=16, channelsPerPage=8) for i in xrange(0, 8): self.assertEquals(8, p.pageUp(i)) for i in xrange(8, 16): self.assertEquals(0, p.pageUp(i))
def test_pageUp_numChannels_lt_channelsPerPage(self): p = Pager(numChannels=5, channelsPerPage=8) for i in xrange(0, 5): self.assertEquals(0, p.pageUp(i))