def test_pageDown_numChannels_gt_channelsPerPage(self): p = Pager(numChannels=18, channelsPerPage=8) for i in xrange(0, 8): self.assertEquals(8, p.pageDown(i)) for i in xrange(8, 16): self.assertEquals(16, p.pageDown(i)) for i in xrange(16, 19): self.assertEquals(0, p.pageDown(i))
def test_pageDown_numChannels_gt_channelsPerPage(self): p = Pager(numChannels=18, channelsPerPage=8) for i in xrange(0, 8): self.assertEquals(8, p.pageDown(i)) for i in xrange(8, 16): self.assertEquals(16, p.pageDown(i)) for i in xrange(16,19): self.assertEquals(0, p.pageDown(i))
def test_pageDown_numChannels_divisible_channelsPerPage(self): p = Pager(numChannels=24, channelsPerPage=8) for i in xrange(0, 8): self.assertEquals(8, p.pageDown(i)) for i in xrange(8, 16): self.assertEquals(16, p.pageDown(i), 'i=%d' % i) for i in xrange(16, 24): self.assertEquals(0, p.pageDown(i), 'i=%d' % i) p = Pager(numChannels=16, channelsPerPage=8) for i in xrange(0, 8): self.assertEquals(8, p.pageDown(i)) for i in xrange(8, 16): self.assertEquals(0, p.pageDown(i), 'i=%d' % i) p = Pager(numChannels=8, channelsPerPage=8) for i in xrange(0, 8): self.assertEquals(0, p.pageDown(i))
def test_pageDown_numChannels_divisible_channelsPerPage(self): p = Pager(numChannels=24, channelsPerPage=8) for i in xrange(0, 8): self.assertEquals(8, p.pageDown(i)) for i in xrange(8, 16): self.assertEquals(16, p.pageDown(i), 'i=%d'%i) for i in xrange(16, 24): self.assertEquals(0, p.pageDown(i), 'i=%d'%i) p = Pager(numChannels=16, channelsPerPage=8) for i in xrange(0, 8): self.assertEquals(8, p.pageDown(i)) for i in xrange(8, 16): self.assertEquals(0, p.pageDown(i), 'i=%d'%i) p = Pager(numChannels=8, channelsPerPage=8) for i in xrange(0, 8): self.assertEquals(0, p.pageDown(i))
def test_pageDown_numChannels_lt_channelsPerPage(self): p = Pager(numChannels=5, channelsPerPage=8) for i in xrange(0, 5): self.assertEquals(0, p.pageDown(i))