def test_2_MultiDownload(self):
        volume = RESTfulBlockwiseFileset(self.descriptionFilePath)

        slicing = numpy.s_[0:25, 10:30, 0:20]
        roi = sliceToRoi(slicing, volume.description.shape)
        data = volume.readData(roi)
        assert data.shape == (25, 20, 20)

        assert volume.getBlockStatus(([0, 0, 0])) == BlockwiseFileset.BLOCK_AVAILABLE
        assert volume.getBlockStatus(([20, 0, 0])) == BlockwiseFileset.BLOCK_AVAILABLE
        assert volume.getBlockStatus(([20, 20, 0])) == BlockwiseFileset.BLOCK_AVAILABLE
        assert volume.getBlockStatus(([0, 20, 0])) == BlockwiseFileset.BLOCK_AVAILABLE
    def test_2_MultiDownload(self):
        volume = RESTfulBlockwiseFileset(self.descriptionFilePath)

        slicing = numpy.s_[0:25, 10:30, 0:20]
        roi = sliceToRoi(slicing, volume.description.shape)
        data = volume.readData(roi)
        assert data.shape == (25, 20, 20)

        assert volume.getBlockStatus(([0, 0,
                                       0])) == BlockwiseFileset.BLOCK_AVAILABLE
        assert volume.getBlockStatus(([20, 0,
                                       0])) == BlockwiseFileset.BLOCK_AVAILABLE
        assert volume.getBlockStatus(([20, 20,
                                       0])) == BlockwiseFileset.BLOCK_AVAILABLE
        assert volume.getBlockStatus(([0, 20,
                                       0])) == BlockwiseFileset.BLOCK_AVAILABLE
    def test_4_OffsetDownload(self):
        volume = RESTfulBlockwiseFileset(self.descriptionFilePath)

        slicing = numpy.s_[20:40, 20:40, 20:40]
        roi = sliceToRoi(slicing, volume.description.shape)
        data = volume.readData(roi)
        assert data.shape == (20, 20, 20)
        assert volume.getBlockStatus(([20, 20, 20])) == BlockwiseFileset.BLOCK_AVAILABLE

        offsetVolume = RESTfulBlockwiseFileset(self.descriptionFilePath_offset)
        offsetSlicing = numpy.s_[20:40, 0:20, 20:40]  # Note middle slice is offset (see view_origin in setup_class)
        offsetRoi = sliceToRoi(offsetSlicing, offsetVolume.description.shape)
        offsetData = offsetVolume.readData(offsetRoi)
        assert offsetData.shape == (20, 20, 20)
        assert offsetVolume.getBlockStatus(([20, 0, 20])) == BlockwiseFileset.BLOCK_AVAILABLE

        # Data should be the same
        assert (offsetData == data).all()
    def test_4_OffsetDownload(self):
        volume = RESTfulBlockwiseFileset(self.descriptionFilePath)

        slicing = numpy.s_[20:40, 20:40, 20:40]
        roi = sliceToRoi(slicing, volume.description.shape)
        data = volume.readData(roi)
        assert data.shape == (20, 20, 20)
        assert volume.getBlockStatus(
            ([20, 20, 20])) == BlockwiseFileset.BLOCK_AVAILABLE

        offsetVolume = RESTfulBlockwiseFileset(self.descriptionFilePath_offset)
        offsetSlicing = numpy.s_[
            20:40, 0:20, 20:
            40]  # Note middle slice is offset (see view_origin in setupClass)
        offsetRoi = sliceToRoi(offsetSlicing, offsetVolume.description.shape)
        offsetData = offsetVolume.readData(offsetRoi)
        assert offsetData.shape == (20, 20, 20)
        assert offsetVolume.getBlockStatus(
            ([20, 0, 20])) == BlockwiseFileset.BLOCK_AVAILABLE

        # Data should be the same
        assert (offsetData == data).all()