@pytest.mark.remote
def test_output_single_gtiff_cog_s3(output_single_gtiff_cog, mp_s3_tmpdir):
    tile_id = (5, 3, 7)
    with mapchete.open(dict(output_single_gtiff_cog.dict, output=dict(output_single_gtiff_cog.dict['output'], path=os.path.join(mp_s3_tmpdir, 'cog.tif')))) as mp:
        process_tile = mp.config.process_pyramid.tile(*tile_id)
        assert mp.config.output.profile()
        assert mp.config.output.empty(process_tile).mask.all()
        assert mp.config.output.get_path(process_tile)
        assert (not mp.config.output.tiles_exist(process_tile))
        mp.batch_process(multi=2)
        assert mp.config.output.tiles_exist(process_tile)
        data = mp.config.output.read(process_tile)
        assert isinstance(data, np.ndarray)
        assert (not data[0].mask.all())
        data = ma.masked_array(data=np.ones(process_tile.shape), mask=np.ones(process_tile.shape))
        mp.config.output.write(process_tile, data)
    assert path_exists(mp.config.output.path)
    assert cog_validate(mp.config.output.path, strict=True)
@pytest.mark.remote
def test_output_single_gtiff_cog_s3(output_single_gtiff_cog, mp_s3_tmpdir):
    tile_id = (5, 3, 7)
    with mapchete.open(dict(output_single_gtiff_cog.dict, output=dict(output_single_gtiff_cog.dict['output'], path=os.path.join(mp_s3_tmpdir, 'cog.tif')))) as mp:
        process_tile = mp.config.process_pyramid.tile(*tile_id)
        assert mp.config.output.profile()
        assert mp.config.output.empty(process_tile).mask.all()
        assert mp.config.output.get_path(process_tile)
        assert (not mp.config.output.tiles_exist(process_tile))
        mp.batch_process(multi=2)
        assert mp.config.output.tiles_exist(process_tile)
        data = mp.config.output.read(process_tile)
        assert isinstance(data, np.ndarray)
        assert (not data[0].mask.all())
        data = ma.masked_array(data=np.ones(process_tile.shape), mask=np.ones(process_tile.shape))
        mp.config.output.write(process_tile, data)
    assert path_exists(mp.config.output.path)
    assert cog_validate(mp.config.output.path, strict=True)