def testGetPart_impossible(self): """Test basic partitioning""" ps = SimplePartitionStrategy(4, 3000) self.assertEqual((0, 750), ps.getPart(0)) self.assertEqual((750, 750), ps.getPart(1)) self.assertEqual((1500, 750), ps.getPart(2)) self.assertEqual((2250, 750), ps.getPart(3))
def testGetPart_impossible(self): """Test basic partitioning""" ps = SimplePartitionStrategy(4, 3000) self.assertEqual( (0, 750), ps.getPart(0) ) self.assertEqual( (750, 750), ps.getPart(1) ) self.assertEqual( (1500, 750), ps.getPart(2) ) self.assertEqual( (2250, 750), ps.getPart(3) )
def testGetPart_perfect(self): """Test basic partitioning""" ps = SimplePartitionStrategy(8, 800) self.assertEqual((0, 100), ps.getPart(0)) self.assertEqual((100, 100), ps.getPart(1)) self.assertEqual((200, 100), ps.getPart(2)) self.assertEqual((300, 100), ps.getPart(3)) self.assertEqual((400, 100), ps.getPart(4)) self.assertEqual((500, 100), ps.getPart(5)) self.assertEqual((600, 100), ps.getPart(6)) self.assertEqual((700, 100), ps.getPart(7))
def testGetPart_perfect(self): """Test basic partitioning""" ps = SimplePartitionStrategy(8, 800) self.assertEqual( (0, 100), ps.getPart(0) ) self.assertEqual( (100, 100), ps.getPart(1) ) self.assertEqual( (200, 100), ps.getPart(2) ) self.assertEqual( (300, 100), ps.getPart(3) ) self.assertEqual( (400, 100), ps.getPart(4) ) self.assertEqual( (500, 100), ps.getPart(5) ) self.assertEqual( (600, 100), ps.getPart(6) ) self.assertEqual( (700, 100), ps.getPart(7) )
def testGetPart_uneven(self): """Test basic partitioning""" ps = SimplePartitionStrategy(3, 7000) self.assertEqual((0, 2333), ps.getPart(0)) self.assertEqual((2333, 2333), ps.getPart(1)) self.assertEqual((4666, 2334), ps.getPart(2))
def testGetPart_even(self): """Test basic partitioning""" ps = SimplePartitionStrategy(3, 6144) self.assertEqual((0, 2048), ps.getPart(0)) self.assertEqual((2048, 2048), ps.getPart(1)) self.assertEqual((4096, 2048), ps.getPart(2))
def testGetPart_uneven(self): """Test basic partitioning""" ps = SimplePartitionStrategy(3, 7000) self.assertEqual( (0, 2333), ps.getPart(0) ) self.assertEqual( (2333, 2333), ps.getPart(1) ) self.assertEqual( (4666, 2334), ps.getPart(2) )
def testGetPart_even(self): """Test basic partitioning""" ps = SimplePartitionStrategy(3, 6144) self.assertEqual( (0, 2048), ps.getPart(0) ) self.assertEqual( (2048, 2048), ps.getPart(1) ) self.assertEqual( (4096, 2048), ps.getPart(2) )