Skip to content
Permalink
Browse files
Add test for csvt fields types names non lowercase
Ensure the fields types names are recognized when they are not lowercase too
  • Loading branch information
agiudiceandrea committed Nov 21, 2021
1 parent 3920e7f commit 6a44d7231d28829e986feabd9bcb8dcb8b58f3bb
@@ -933,6 +933,13 @@ def test_047_datetime(self):
assert vl.fields().at(6).type() == QVariant.Time
assert vl.fields().at(9).type() == QVariant.String

def test_048_csvt_file(self):
# CSVT field types non lowercase
filename = 'testcsvt5.csv'
params = {'geomType': 'none', 'type': 'csv'}
requests = None
self.runTest(filename, requests, **params)

def testSpatialIndex(self):
srcpath = os.path.join(TEST_DATA_DIR, 'provider')
basetestfile = os.path.join(srcpath, 'delimited_xyzm.csv')
@@ -2587,3 +2587,32 @@ def test_042_no_detect_types_csvt():
wanted['log'] = [
]
return wanted


def test_048_csvt_file():
wanted = {}
wanted['uri'] = 'file://testcsvt5.csv?geomType=none&type=csv'
wanted['fieldTypes'] = ['text', 'text', 'double', 'double', 'double']
wanted['geometryType'] = 4
wanted['data'] = {
2: {
'id': '01',
'description': 'Test csvt 1',
'f1': '0.3',
'f2': '0.8',
'f3': '1.4',
'#fid': 2,
'#geometry': 'None',
},
3: {
'id': '12',
'description': 'Test csvt 2',
'f1': '0.2',
'f2': '78.0',
'f3': '13.4',
'#fid': 3,
'#geometry': 'None',
},
}
wanted['log'] = []
return wanted
@@ -0,0 +1,3 @@
id,description,f1,f2,f3
01,Test csvt 1,0.3,0.8,1.4
12,Test csvt 2,0.2,78,13.4
@@ -0,0 +1 @@
"String","String","Real","Real","Real"

0 comments on commit 6a44d72

Please sign in to comment.