Skip to content

Commit 88b3b5b

Browse files
committed
autotest: replace Memory driver by MEM
1 parent 9dbe489 commit 88b3b5b

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

Diff for: autotest/utilities/test_gdalalg_vector_convert.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def test_gdalalg_vector_wrong_layer_name(tmp_vsimem):
144144
convert.ParseRunAndFinalize(
145145
[
146146
"../ogr/data/poly.shp",
147-
"--of=Memory",
147+
"--of=MEM",
148148
"--output=empty",
149149
"--layer",
150150
"invalid",

Diff for: autotest/utilities/test_ogr2ogr_lib.py

+20-20
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ def test_ogr2ogr_lib_sql_filename(tmp_vsimem):
694694
"""-- initial comment\nselect\n'--''--' as literalfield,* from --comment\npoly\n-- trailing comment""",
695695
):
696696
ds = gdal.VectorTranslate(
697-
"", "../ogr/data/poly.shp", options=f"-f Memory -sql @{tmp_vsimem}/my.sql"
697+
"", "../ogr/data/poly.shp", options=f"-f MEM -sql @{tmp_vsimem}/my.sql"
698698
)
699699
lyr = ds.GetLayer(0)
700700
assert lyr.GetFeatureCount() == 10
@@ -818,7 +818,7 @@ def test_ogr2ogr_assign_coord_epoch():
818818
src_ds.CreateLayer("layer")
819819

820820
ds = gdal.VectorTranslate(
821-
"", src_ds, options="-f Memory -a_srs EPSG:7665 -a_coord_epoch 2021.3"
821+
"", src_ds, options="-f MEM -a_srs EPSG:7665 -a_coord_epoch 2021.3"
822822
)
823823
lyr = ds.GetLayer(0)
824824
srs = lyr.GetSpatialRef()
@@ -842,7 +842,7 @@ def test_ogr2ogr_s_coord_epoch():
842842
ds = gdal.VectorTranslate(
843843
"",
844844
src_ds,
845-
options="-f Memory -s_srs EPSG:9000 -s_coord_epoch 2030 -t_srs EPSG:7844",
845+
options="-f MEM -s_srs EPSG:9000 -s_coord_epoch 2030 -t_srs EPSG:7844",
846846
)
847847
lyr = ds.GetLayer(0)
848848
f = lyr.GetNextFeature()
@@ -868,7 +868,7 @@ def test_ogr2ogr_t_coord_epoch():
868868
ds = gdal.VectorTranslate(
869869
"",
870870
src_ds,
871-
options="-f Memory -t_srs EPSG:9000 -t_coord_epoch 2030 -s_srs EPSG:7844",
871+
options="-f MEM -t_srs EPSG:9000 -t_coord_epoch 2030 -s_srs EPSG:7844",
872872
)
873873
lyr = ds.GetLayer(0)
874874
f = lyr.GetNextFeature()
@@ -1739,25 +1739,25 @@ def test_ogr2ogr_lib_dateTimeTo():
17391739

17401740
with gdal.quiet_errors():
17411741
with pytest.raises(Exception):
1742-
gdal.VectorTranslate("", src_ds, options="-f Memory -dateTimeTo")
1742+
gdal.VectorTranslate("", src_ds, options="-f MEM -dateTimeTo")
17431743
with pytest.raises(Exception):
1744-
gdal.VectorTranslate("", src_ds, options="-f Memory -dateTimeTo foo")
1744+
gdal.VectorTranslate("", src_ds, options="-f MEM -dateTimeTo foo")
17451745
with pytest.raises(Exception):
1746-
gdal.VectorTranslate("", src_ds, options="-f Memory -dateTimeTo UTCx")
1746+
gdal.VectorTranslate("", src_ds, options="-f MEM -dateTimeTo UTCx")
17471747
with pytest.raises(Exception):
1748-
gdal.VectorTranslate("", src_ds, options="-f Memory -dateTimeTo UTCx12")
1748+
gdal.VectorTranslate("", src_ds, options="-f MEM -dateTimeTo UTCx12")
17491749
with pytest.raises(Exception):
1750-
gdal.VectorTranslate("", src_ds, options="-f Memory -dateTimeTo UTC+15")
1750+
gdal.VectorTranslate("", src_ds, options="-f MEM -dateTimeTo UTC+15")
17511751
with pytest.raises(Exception):
1752-
gdal.VectorTranslate("", src_ds, options="-f Memory -dateTimeTo UTC+12:")
1752+
gdal.VectorTranslate("", src_ds, options="-f MEM -dateTimeTo UTC+12:")
17531753
with pytest.raises(Exception):
1754-
gdal.VectorTranslate("", src_ds, options="-f Memory -dateTimeTo UTC+12:3")
1754+
gdal.VectorTranslate("", src_ds, options="-f MEM -dateTimeTo UTC+12:3")
17551755
with pytest.raises(Exception):
1756-
gdal.VectorTranslate("", src_ds, options="-f Memory -dateTimeTo UTC+12:34")
1756+
gdal.VectorTranslate("", src_ds, options="-f MEM -dateTimeTo UTC+12:34")
17571757
with pytest.raises(Exception):
1758-
gdal.VectorTranslate("", src_ds, options="-f Memory -dateTimeTo UTC+12:345")
1758+
gdal.VectorTranslate("", src_ds, options="-f MEM -dateTimeTo UTC+12:345")
17591759

1760-
dst_ds = gdal.VectorTranslate("", src_ds, options="-f Memory -dateTimeTo UTC+03:00")
1760+
dst_ds = gdal.VectorTranslate("", src_ds, options="-f MEM -dateTimeTo UTC+03:00")
17611761
dst_lyr = dst_ds.GetLayer(0)
17621762
f = dst_lyr.GetNextFeature()
17631763
assert f["dt"] == "2023/02/01 02:19:56.789+03"
@@ -1769,22 +1769,22 @@ def test_ogr2ogr_lib_dateTimeTo():
17691769
f = dst_lyr.GetNextFeature()
17701770
assert not f.IsFieldSet("dt")
17711771

1772-
dst_ds = gdal.VectorTranslate("", src_ds, options="-f Memory -dateTimeTo UTC")
1772+
dst_ds = gdal.VectorTranslate("", src_ds, options="-f MEM -dateTimeTo UTC")
17731773
dst_lyr = dst_ds.GetLayer(0)
17741774
f = dst_lyr.GetNextFeature()
17751775
assert f["dt"] == "2023/01/31 23:19:56.789+00"
17761776

1777-
dst_ds = gdal.VectorTranslate("", src_ds, options="-f Memory -dateTimeTo UTC-13:15")
1777+
dst_ds = gdal.VectorTranslate("", src_ds, options="-f MEM -dateTimeTo UTC-13:15")
17781778
dst_lyr = dst_ds.GetLayer(0)
17791779
f = dst_lyr.GetNextFeature()
17801780
assert f["dt"] == "2023/01/31 10:04:56.789-1315"
17811781

1782-
dst_ds = gdal.VectorTranslate("", src_ds, options="-f Memory -dateTimeTo UTC-13:30")
1782+
dst_ds = gdal.VectorTranslate("", src_ds, options="-f MEM -dateTimeTo UTC-13:30")
17831783
dst_lyr = dst_ds.GetLayer(0)
17841784
f = dst_lyr.GetNextFeature()
17851785
assert f["dt"] == "2023/01/31 09:49:56.789-1330"
17861786

1787-
dst_ds = gdal.VectorTranslate("", src_ds, options="-f Memory -dateTimeTo UTC-13:45")
1787+
dst_ds = gdal.VectorTranslate("", src_ds, options="-f MEM -dateTimeTo UTC-13:45")
17881788
dst_lyr = dst_ds.GetLayer(0)
17891789
f = dst_lyr.GetNextFeature()
17901790
assert f["dt"] == "2023/01/31 09:34:56.789-1345"
@@ -2821,7 +2821,7 @@ def test_ogr2ogr_lib_not_enough_gcp():
28212821
with pytest.raises(
28222822
Exception, match="Failed to compute GCP transform: Not enough points available"
28232823
):
2824-
gdal.VectorTranslate("", src_ds, options="-f Memory -gcp 0 0 0 0")
2824+
gdal.VectorTranslate("", src_ds, options="-f MEM -gcp 0 0 0 0")
28252825

28262826

28272827
###############################################################################
@@ -2836,7 +2836,7 @@ def test_ogr2ogr_lib_two_gcps():
28362836
src_lyr.CreateFeature(f)
28372837

28382838
out_ds = gdal.VectorTranslate(
2839-
"", src_ds, options="-f Memory -gcp 1 2 200 300 -gcp 3 4 300 400"
2839+
"", src_ds, options="-f MEM -gcp 1 2 200 300 -gcp 3 4 300 400"
28402840
)
28412841
out_lyr = out_ds.GetLayer(0)
28422842
f = out_lyr.GetNextFeature()

0 commit comments

Comments
 (0)