Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added SIP version test to delimited text test script
  • Loading branch information
ccrook committed Jun 18, 2013
1 parent 9eacb74 commit 7a2ff54
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/src/python/test_qgsdelimitedtextprovider.py
Expand Up @@ -58,9 +58,14 @@
unittest
#expectedFailure
)

import sip

QGISAPP, CANVAS, IFACE, PARENT = getQgisTestApp()


sipversion=str(sip.getapi('QVariant'))
sipwanted='2'
geomkey = "#geometry"
fidkey = "#fid"
tolerance = 0.000001 # Tolerance for coordinate comparisons in checkWktEqual
Expand Down Expand Up @@ -115,7 +120,7 @@ def layerData( layer, request={}, offset=0 ):
for field in f.fields():
fields.append(str(field.name()))
fieldTypes.append(str(field.typeName()))
fielddata = dict ( (name, unicode(f[name].toString()) ) for name in fields )
fielddata = dict ( (name, unicode(f[name]) ) for name in fields )
g = f.geometry()
if g:
fielddata[geomkey] = str(g.exportToWkt());
Expand Down Expand Up @@ -256,6 +261,9 @@ def recordDifference( record1, record2 ):
return ''

def runTest( file, requests, **params ):
# No point doing test if haven't got the right SIP vesion
if sipversion != sipwanted:
return
testname=inspect.stack()[1][3];
verbose = not rebuildTests
if verbose:
Expand Down Expand Up @@ -327,6 +335,7 @@ def test_001_provider_defined( self ):
registry=QgsProviderRegistry.instance()
metadata = registry.providerMetadata('delimitedtext')
assert metadata != None, "Delimited text provider is not installed"
assert sipversion==sipwanted,"SIP version "+sipversion+" - require version "+sipwanted+" for delimited text tests"

def test_002_load_csv_file(self):
# CSV file parsing
Expand Down

0 comments on commit 7a2ff54

Please sign in to comment.