Skip to content

Commit e04eb03

Browse files
committed
Adding some more tests on boolean fields
1 parent d0ac903 commit e04eb03

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

autotest/ogr/ogr_miramon_vector.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -998,6 +998,9 @@ def create_common_attributes(lyr):
998998
lyr.CreateField(ogr.FieldDefn("int64listfield", ogr.OFTInteger64List))
999999
lyr.CreateField(ogr.FieldDefn("doulistfield", ogr.OFTRealList))
10001000
lyr.CreateField(ogr.FieldDefn("datefield", ogr.OFTDate))
1001+
f = ogr.FieldDefn("boolfield", ogr.OFTInteger)
1002+
f.SetSubType(ogr.OFSTBoolean)
1003+
lyr.CreateField(f)
10011004

10021005

10031006
def assign_common_attributes(f):
@@ -1010,6 +1013,7 @@ def assign_common_attributes(f):
10101013
f["int64listfield"] = [12345678912345678]
10111014
f["doulistfield"] = [1.5, 4.2]
10121015
f["datefield"] = "2024/04/24"
1016+
f["boolfield"] = 1
10131017

10141018

10151019
def check_common_attributes(f):
@@ -1022,6 +1026,7 @@ def check_common_attributes(f):
10221026
assert f["int64listfield"] == [12345678912345678]
10231027
assert f["doulistfield"] == [1.5, 4.2]
10241028
assert f["datefield"] == "2024/04/24"
1029+
assert f["boolfield"] == [True]
10251030

10261031

10271032
def open_ds_lyr_0_feature_0(layername):
@@ -1054,7 +1059,7 @@ def test_ogr_miramon_write_basic_polygon(tmp_path):
10541059

10551060
assert f["ID_GRAFIC"] == [1, 1]
10561061
assert f["N_VERTEXS"] == [4, 4]
1057-
assert f["PERIMETRE"] == [3.414213562, 3.414213562]
1062+
assert f["PERIMETRE"] == [3.414, 3.414]
10581063
assert f["AREA"] == [0.500000000000, 0.500000000000]
10591064
assert f["N_ARCS"] == [1, 1]
10601065
assert f["N_POLIG"] == [1, 1]

0 commit comments

Comments
 (0)