@@ -132,7 +132,7 @@ def setUpClass(cls):
132
132
133
133
# Create test layer
134
134
cls .vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename'" , 'test' , 'WFS' )
135
- assert ( cls .vl .isValid () )
135
+ assert cls .vl .isValid ()
136
136
cls .source = cls .vl .dataProvider ()
137
137
138
138
with open (sanitize (endpoint , '?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=my:typename&SRSNAME=urn:ogc:def:crs:EPSG::4326' ), 'wb' ) as f :
@@ -362,7 +362,7 @@ def testInconsistentUri(self):
362
362
363
363
# Could not find typename my:typename in capabilities
364
364
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename'" , 'test' , 'WFS' )
365
- assert not vl .isValid ()
365
+ self . assertFalse ( vl .isValid () )
366
366
367
367
def testWFS10 (self ):
368
368
"""Test WFS 1.0 read-only"""
@@ -409,7 +409,7 @@ def testWFS10(self):
409
409
""" .encode ('UTF-8' ))
410
410
411
411
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename' version='1.0.0'" , 'test' , 'WFS' )
412
- assert vl .isValid ()
412
+ self . assertTrue ( vl .isValid () )
413
413
self .assertEqual (vl .wkbType (), QgsWkbTypes .Point )
414
414
self .assertEqual (len (vl .fields ()), 5 )
415
415
self .assertEqual (vl .featureCount (), 0 )
@@ -467,9 +467,9 @@ def testWFS10(self):
467
467
self .assertEqual (vl .dataProvider ().capabilities (), QgsVectorDataProvider .SelectAtId )
468
468
469
469
(ret , _ ) = vl .dataProvider ().addFeatures ([QgsFeature ()])
470
- assert not ret
470
+ self . assertFalse ( ret )
471
471
472
- assert not vl .dataProvider ().deleteFeatures ([0 ])
472
+ self . assertFalse ( vl .dataProvider ().deleteFeatures ([0 ]) )
473
473
474
474
# Test with restrictToRequestBBOX=1
475
475
with open (sanitize (endpoint , '?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.0.0&TYPENAME=my:typename&SRSNAME=EPSG:32631&BBOX=400000,5400000,450000,5500000' ), 'wb' ) as f :
@@ -545,7 +545,7 @@ def testWFS10_outputformat_GML3(self):
545
545
""" .encode ('UTF-8' ))
546
546
547
547
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename' version='1.0.0'" , 'test' , 'WFS' )
548
- assert vl .isValid ()
548
+ self . assertTrue ( vl .isValid () )
549
549
550
550
with open (sanitize (endpoint , '?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.0.0&TYPENAME=my:typename&SRSNAME=EPSG:32631&OUTPUTFORMAT=GML3' ), 'wb' ) as f :
551
551
f .write ("""
@@ -569,7 +569,7 @@ def testWFS10_outputformat_GML3(self):
569
569
570
570
# Test with explicit OUTPUTFORMAT as parameter
571
571
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename' version='1.0.0' outputformat='GML2'" , 'test' , 'WFS' )
572
- assert vl .isValid ()
572
+ self . assertTrue ( vl .isValid () )
573
573
574
574
with open (sanitize (endpoint , '?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.0.0&TYPENAME=my:typename&SRSNAME=EPSG:32631&OUTPUTFORMAT=GML2' ), 'wb' ) as f :
575
575
f .write ("""
@@ -593,7 +593,7 @@ def testWFS10_outputformat_GML3(self):
593
593
594
594
# Test with explicit OUTPUTFORMAT in URL
595
595
vl = QgsVectorLayer ("url='http://" + endpoint + "?OUTPUTFORMAT=GML2' typename='my:typename' version='1.0.0'" , 'test' , 'WFS' )
596
- assert vl .isValid ()
596
+ self . assertTrue ( vl .isValid () )
597
597
598
598
with open (sanitize (endpoint , '?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.0.0&TYPENAME=my:typename&SRSNAME=EPSG:32631&OUTPUTFORMAT=GML2' ), 'wb' ) as f :
599
599
f .write ("""
@@ -654,7 +654,7 @@ def testWFS10_latlongboundingbox_in_WGS84(self):
654
654
""" .encode ('UTF-8' ))
655
655
656
656
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename' version='1.0.0'" , 'test' , 'WFS' )
657
- assert vl .isValid ()
657
+ self . assertTrue ( vl .isValid () )
658
658
659
659
reference = QgsGeometry .fromRect (QgsRectangle (399999.9999999680439942 , 5399338.9090830031782389 , 449999.9999999987776391 , 5500658.0448500607162714 ))
660
660
vl_extent = QgsGeometry .fromRect (vl .extent ())
@@ -707,7 +707,7 @@ def testWFST10(self):
707
707
""" .encode ('UTF-8' ))
708
708
709
709
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename' version='1.0.0'" , 'test' , 'WFS' )
710
- assert vl .isValid ()
710
+ self . assertTrue ( vl .isValid () )
711
711
712
712
self .assertEqual (vl .dataProvider ().capabilities (),
713
713
QgsVectorDataProvider .AddFeatures |
@@ -717,17 +717,17 @@ def testWFST10(self):
717
717
QgsVectorDataProvider .SelectAtId )
718
718
719
719
(ret , _ ) = vl .dataProvider ().addFeatures ([QgsFeature ()])
720
- assert not ret
720
+ self . assertFalse ( ret )
721
721
722
722
self .assertEqual (vl .featureCount (), 0 )
723
723
724
- assert not vl .dataProvider ().deleteFeatures ([0 ])
724
+ self . assertFalse ( vl .dataProvider ().deleteFeatures ([0 ]) )
725
725
726
726
self .assertEqual (vl .featureCount (), 0 )
727
727
728
- assert not vl .dataProvider ().changeGeometryValues ({0 : QgsGeometry .fromWkt ('Point (3 50)' )})
728
+ self . assertFalse ( vl .dataProvider ().changeGeometryValues ({0 : QgsGeometry .fromWkt ('Point (3 50)' )}) )
729
729
730
- assert not vl .dataProvider ().changeAttributeValues ({0 : {0 : 0 }})
730
+ self . assertFalse ( vl .dataProvider ().changeAttributeValues ({0 : {0 : 0 }}) )
731
731
732
732
# Test addFeatures
733
733
response = """
@@ -753,8 +753,15 @@ def testWFST10(self):
753
753
f = QgsFeature ()
754
754
f .setAttributes ([1 , 1234567890123 , 'foo' , QDateTime (2016 , 4 , 10 , 12 , 34 , 56 , 789 , Qt .TimeSpec (Qt .UTC ))])
755
755
f .setGeometry (QgsGeometry .fromWkt ('Point (2 49)' ))
756
+
757
+ def logMessage (self , msg , tag , level ):
758
+ print ('--------################----------------' )
759
+ print (msg )
760
+ print ('--------################----------------' )
761
+
762
+ QgsApplication .messageLog ().messageReceived .connect (logMessage )
756
763
(ret , fl ) = vl .dataProvider ().addFeatures ([f ])
757
- assert ret
764
+ self . assertTrue ( ret )
758
765
self .assertEqual (fl [0 ].id (), 1 )
759
766
760
767
self .assertEqual (vl .featureCount (), 1 )
@@ -793,8 +800,7 @@ def testWFST10(self):
793
800
with open (sanitize (endpoint , '?SERVICE=WFS&POSTDATA=<Transaction xmlns="http://www.opengis.net/wfs" service="WFS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://my http://fake_qgis_http_endpoint?REQUEST=DescribeFeatureType&VERSION=1.0.0&TYPENAME=my:typename" xmlns:my="http://my" xmlns:gml="http://www.opengis.net/gml" version="1.0.0"><Update xmlns="http://www.opengis.net/wfs" typeName="my:typename"><Property xmlns="http://www.opengis.net/wfs"><Name xmlns="http://www.opengis.net/wfs">geometryProperty</Name><Value xmlns="http://www.opengis.net/wfs"><gml:Point srsName="EPSG:4326"><gml:coordinates cs="," ts=" ">3,50</gml:coordinates></gml:Point></Value></Property><Filter xmlns="http://www.opengis.net/ogc"><FeatureId xmlns="http://www.opengis.net/ogc" fid="typename.1"/></Filter></Update></Transaction>' ), 'wb' ) as f :
794
801
f .write (content .encode ('UTF-8' ))
795
802
796
- ret = vl .dataProvider ().changeGeometryValues ({1 : QgsGeometry .fromWkt ('Point (3 50)' )})
797
- assert ret
803
+ self .assertTrue (vl .dataProvider ().changeGeometryValues ({1 : QgsGeometry .fromWkt ('Point (3 50)' )}))
798
804
799
805
got_f = [f for f in vl .getFeatures ()]
800
806
got = got_f [0 ].geometry ().geometry ()
@@ -829,7 +835,7 @@ def testWFST10(self):
829
835
with open (sanitize (endpoint , '?SERVICE=WFS&POSTDATA=<Transaction xmlns="http://www.opengis.net/wfs" service="WFS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://my http://fake_qgis_http_endpoint?REQUEST=DescribeFeatureType&VERSION=1.0.0&TYPENAME=my:typename" xmlns:my="http://my" xmlns:gml="http://www.opengis.net/gml" version="1.0.0"><Update xmlns="http://www.opengis.net/wfs" typeName="my:typename"><Property xmlns="http://www.opengis.net/wfs"><Name xmlns="http://www.opengis.net/wfs">intfield</Name><Value xmlns="http://www.opengis.net/wfs">2</Value></Property><Property xmlns="http://www.opengis.net/wfs"><Name xmlns="http://www.opengis.net/wfs">longfield</Name><Value xmlns="http://www.opengis.net/wfs">3</Value></Property><Property xmlns="http://www.opengis.net/wfs"><Name xmlns="http://www.opengis.net/wfs">stringfield</Name><Value xmlns="http://www.opengis.net/wfs">bar</Value></Property><Property xmlns="http://www.opengis.net/wfs"><Name xmlns="http://www.opengis.net/wfs">datetimefield</Name><Value xmlns="http://www.opengis.net/wfs">2015-04-10T12:34:56.789Z</Value></Property><Filter xmlns="http://www.opengis.net/ogc"><FeatureId xmlns="http://www.opengis.net/ogc" fid="typename.1"/></Filter></Update></Transaction>' ), 'wb' ) as f :
830
836
f .write (content .encode ('UTF-8' ))
831
837
832
- assert vl .dataProvider ().changeAttributeValues ({1 : {0 : 2 , 1 : 3 , 2 : "bar" , 3 : QDateTime (2015 , 4 , 10 , 12 , 34 , 56 , 789 , Qt .TimeSpec (Qt .UTC ))}})
838
+ self . assertTrue ( vl .dataProvider ().changeAttributeValues ({1 : {0 : 2 , 1 : 3 , 2 : "bar" , 3 : QDateTime (2015 , 4 , 10 , 12 , 34 , 56 , 789 , Qt .TimeSpec (Qt .UTC ))}}) )
833
839
834
840
values = [f ['intfield' ] for f in vl .getFeatures ()]
835
841
self .assertEqual (values , [2 ])
@@ -864,7 +870,7 @@ def testWFST10(self):
864
870
with open (sanitize (endpoint , '?SERVICE=WFS&POSTDATA=<Transaction xmlns="http://www.opengis.net/wfs" service="WFS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://my http://fake_qgis_http_endpoint?REQUEST=DescribeFeatureType&VERSION=1.0.0&TYPENAME=my:typename" xmlns:my="http://my" xmlns:gml="http://www.opengis.net/gml" version="1.0.0"><Delete xmlns="http://www.opengis.net/wfs" typeName="my:typename"><Filter xmlns="http://www.opengis.net/ogc"><FeatureId xmlns="http://www.opengis.net/ogc" fid="typename.1"/></Filter></Delete></Transaction>' ), 'wb' ) as f :
865
871
f .write (content .encode ('UTF-8' ))
866
872
867
- assert vl .dataProvider ().deleteFeatures ([1 ])
873
+ self . assertTrue ( vl .dataProvider ().deleteFeatures ([1 ]) )
868
874
869
875
self .assertEqual (vl .featureCount (), 0 )
870
876
@@ -936,7 +942,7 @@ def testWFS20Paging(self):
936
942
937
943
# Create test layer
938
944
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename'" , 'test' , 'WFS' )
939
- assert vl .isValid ()
945
+ self . assertTrue ( vl .isValid () )
940
946
self .assertEqual (vl .wkbType (), QgsWkbTypes .Point )
941
947
942
948
with open (sanitize (endpoint , '?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=my:typename&STARTINDEX=1&COUNT=1&SRSNAME=urn:ogc:def:crs:EPSG::4326' ), 'wb' ) as f :
@@ -1046,7 +1052,7 @@ def testWFSGetOnlyFeaturesInViewExtent(self):
1046
1052
1047
1053
# Create test layer
1048
1054
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename' restrictToRequestBBOX=1" , 'test' , 'WFS' )
1049
- assert vl .isValid ()
1055
+ self . assertTrue ( vl .isValid () )
1050
1056
self .assertEqual (vl .wkbType (), QgsWkbTypes .Point )
1051
1057
1052
1058
last_url = sanitize (endpoint , '?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&TYPENAME=my:typename&MAXFEATURES=2&SRSNAME=urn:ogc:def:crs:EPSG::4326&BBOX=60,-70,80,-60,urn:ogc:def:crs:EPSG::4326' )
@@ -1232,7 +1238,7 @@ def testWFS20TruncatedResponse(self):
1232
1238
1233
1239
# Create test layer
1234
1240
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename'" , 'test' , 'WFS' )
1235
- assert vl .isValid ()
1241
+ self . assertTrue ( vl .isValid () )
1236
1242
1237
1243
# Check that we get a log message
1238
1244
with MessageLogger ('WFS' ) as logger :
@@ -1276,7 +1282,7 @@ def testRetryLogic(self):
1276
1282
""" .encode ('UTF-8' ))
1277
1283
1278
1284
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename' version='1.0.0'" , 'test' , 'WFS' )
1279
- assert vl .isValid ()
1285
+ self . assertTrue ( vl .isValid () )
1280
1286
self .assertEqual (vl .wkbType (), QgsWkbTypes .NoGeometry )
1281
1287
self .assertEqual (len (vl .fields ()), 1 )
1282
1288
@@ -1366,7 +1372,7 @@ def testDetachedFeatureSource(self):
1366
1372
""" .encode ('UTF-8' ))
1367
1373
1368
1374
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename' version='1.0.0'" , 'test' , 'WFS' )
1369
- assert vl .isValid ()
1375
+ self . assertTrue ( vl .isValid () )
1370
1376
self .assertEqual (vl .wkbType (), QgsWkbTypes .NoGeometry )
1371
1377
self .assertEqual (len (vl .fields ()), 1 )
1372
1378
@@ -1520,7 +1526,7 @@ def testJoins(self):
1520
1526
1521
1527
# * syntax
1522
1528
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename' version='2.0.0' sql=SELECT * FROM \" my:typename\" JOIN \" my:othertypename\" o ON \" my:typename\" .id = o.main_id WHERE \" my:typename\" .id > 0 ORDER BY \" my:typename\" .id DESC" , 'test' , 'WFS' )
1523
- assert vl .isValid ()
1529
+ self . assertTrue ( vl .isValid () )
1524
1530
self .assertEqual (vl .wkbType (), QgsWkbTypes .Point )
1525
1531
fields = vl .fields ()
1526
1532
self .assertEqual (len (fields ), 3 , fields )
@@ -1533,7 +1539,7 @@ def testJoins(self):
1533
1539
1534
1540
# * syntax with unprefixed typenames
1535
1541
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename' version='2.0.0' sql=SELECT * FROM typename JOIN othertypename o ON typename.id = o.main_id WHERE typename.id > 0 ORDER BY typename.id DESC" , 'test' , 'WFS' )
1536
- assert vl .isValid ()
1542
+ self . assertTrue ( vl .isValid () )
1537
1543
self .assertEqual (vl .wkbType (), QgsWkbTypes .Point )
1538
1544
fields = vl .fields ()
1539
1545
self .assertEqual (len (fields ), 3 , fields )
@@ -1550,7 +1556,7 @@ def testJoins(self):
1550
1556
f .write (schema .encode ('UTF-8' ))
1551
1557
1552
1558
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename' version='2.0.0' sql=SELECT * FROM othertypename o, typename WHERE typename.id = o.main_id AND typename.id > 0 ORDER BY typename.id DESC" , 'test' , 'WFS' )
1553
- assert vl .isValid ()
1559
+ self . assertTrue ( vl .isValid () )
1554
1560
self .assertEqual (vl .wkbType (), QgsWkbTypes .Point )
1555
1561
fields = vl .fields ()
1556
1562
self .assertEqual (len (fields ), 3 , fields )
@@ -1560,7 +1566,7 @@ def testJoins(self):
1560
1566
1561
1567
# main table not appearing in first, not in FROM but in JOIN
1562
1568
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename' version='2.0.0' sql=SELECT * FROM othertypename o JOIN typename ON typename.id = o.main_id WHERE typename.id > 0 ORDER BY typename.id DESC" , 'test' , 'WFS' )
1563
- assert vl .isValid ()
1569
+ self . assertTrue ( vl .isValid () )
1564
1570
self .assertEqual (vl .wkbType (), QgsWkbTypes .Point )
1565
1571
fields = vl .fields ()
1566
1572
self .assertEqual (len (fields ), 3 , fields )
@@ -1942,7 +1948,7 @@ def testSelectDistinct(self):
1942
1948
</wfs:FeatureCollection>""" .encode ('UTF-8' ))
1943
1949
1944
1950
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename' version='2.0.0' sql=SELECT DISTINCT * FROM \" my:typename\" " , 'test' , 'WFS' )
1945
- assert vl .isValid ()
1951
+ self . assertTrue ( vl .isValid () )
1946
1952
1947
1953
values = [(f ['intfield' ], f ['longfield' ], f ['stringfield' ], f ['datetimefield' ]) for f in vl .getFeatures ()]
1948
1954
self .assertEqual (values , [(1 , 1234567890 , 'foo' , QDateTime (2016 , 4 , 10 , 12 , 34 , 56 , 789 , Qt .TimeSpec (Qt .UTC ))),
@@ -1952,7 +1958,7 @@ def testSelectDistinct(self):
1952
1958
(1 , 1234567890 , 'foo' , QDateTime (2016 , 4 , 10 , 12 , 34 , 56 , 788 , Qt .TimeSpec (Qt .UTC )))])
1953
1959
1954
1960
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename' version='2.0.0' sql=SELECT DISTINCT intfield FROM \" my:typename\" " , 'test' , 'WFS' )
1955
- assert vl .isValid ()
1961
+ self . assertTrue ( vl .isValid () )
1956
1962
1957
1963
values = [(f ['intfield' ]) for f in vl .getFeatures ()]
1958
1964
self .assertEqual (values , [(1 ), (2 )])
@@ -2015,7 +2021,7 @@ def testWrongCapabilityExtent(self):
2015
2021
</wfs:FeatureCollection>""" .encode ('UTF-8' ))
2016
2022
2017
2023
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename' version='2.0.0'" , 'test' , 'WFS' )
2018
- assert vl .isValid ()
2024
+ self . assertTrue ( vl .isValid () )
2019
2025
2020
2026
# Download all features
2021
2027
features = [f for f in vl .getFeatures ()]
@@ -2027,7 +2033,7 @@ def testWrongCapabilityExtent(self):
2027
2033
2028
2034
# Same with restrictToRequestBBOX=1
2029
2035
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename' version='2.0.0' restrictToRequestBBOX=1" , 'test' , 'WFS' )
2030
- assert vl .isValid ()
2036
+ self . assertTrue ( vl .isValid () )
2031
2037
2032
2038
# First request that will be attempted
2033
2039
with open (sanitize (endpoint , """?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=my:typename&SRSNAME=urn:ogc:def:crs:EPSG::4326&BBOX=-0.125,-0.125,1.125,1.125,urn:ogc:def:crs:EPSG::4326""" ), 'wb' ) as f :
@@ -2060,7 +2066,7 @@ def testWrongCapabilityExtent(self):
2060
2066
self .assertEqual (len (features ), 0 )
2061
2067
2062
2068
# Check that the approx extent contains the geometry
2063
- assert vl .extent ().contains (QgsPointXY (2 , 49 ))
2069
+ self . assertTrue ( vl .extent ().contains (QgsPointXY (2 , 49 ) ))
2064
2070
2065
2071
def testGeomedia (self ):
2066
2072
"""Test various interoperability specifities that occur with Geomedia Web Server."""
@@ -2158,7 +2164,7 @@ def testGeomedia(self):
2158
2164
QgsSettings ().setValue ('wfs/max_feature_count_if_not_provided' , '1' )
2159
2165
2160
2166
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename' version='2.0.0'" , 'test' , 'WFS' )
2161
- assert vl .isValid ()
2167
+ self . assertTrue ( vl .isValid () )
2162
2168
self .assertEqual (vl .wkbType (), QgsWkbTypes .MultiPolygon )
2163
2169
2164
2170
# Extent before downloading features
@@ -2258,7 +2264,7 @@ def testMapServerWFS1_1_EPSG_4326(self):
2258
2264
""" .encode ('UTF-8' ))
2259
2265
2260
2266
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename' version='1.1.0'" , 'test' , 'WFS' )
2261
- assert vl .isValid ()
2267
+ self . assertTrue ( vl .isValid () )
2262
2268
2263
2269
got_f = [f for f in vl .getFeatures ()]
2264
2270
got = got_f [0 ].geometry ().geometry ()
@@ -2346,7 +2352,7 @@ def testDescribeFeatureTypeWithInlineType(self):
2346
2352
""" .encode ('UTF-8' ))
2347
2353
2348
2354
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename' version='1.1.0'" , 'test' , 'WFS' )
2349
- assert vl .isValid ()
2355
+ self . assertTrue ( vl .isValid () )
2350
2356
2351
2357
got_f = [f for f in vl .getFeatures ()]
2352
2358
got = got_f [0 ].geometry ().geometry ()
@@ -2405,7 +2411,7 @@ def testWFS20TransactionsDisabled(self):
2405
2411
2406
2412
# Create test layer
2407
2413
vl = QgsVectorLayer (u"url='http://" + endpoint + u"' typename='my:typename'" , u'test' , u'WFS' )
2408
- assert vl .isValid ()
2414
+ self . assertTrue ( vl .isValid () )
2409
2415
self .assertEqual (vl .dataProvider ().capabilities () & vl .dataProvider ().EditingCapabilities , vl .dataProvider ().NoCapabilities )
2410
2416
self .assertEqual (vl .wkbType (), QgsWkbTypes .Point )
2411
2417
@@ -2485,7 +2491,7 @@ def testWFS20TransactionsEnabled(self):
2485
2491
2486
2492
# Create test layer
2487
2493
vl = QgsVectorLayer (u"url='http://" + endpoint + u"' typename='my:typename'" , u'test' , u'WFS' )
2488
- assert vl .isValid ()
2494
+ self . assertTrue ( vl .isValid () )
2489
2495
self .assertNotEqual (vl .dataProvider ().capabilities () & vl .dataProvider ().EditingCapabilities , vl .dataProvider ().NoCapabilities )
2490
2496
self .assertEqual (vl .wkbType (), QgsWkbTypes .Point )
2491
2497
@@ -2528,7 +2534,7 @@ def testDeprecatedGML2GeometryDeclaration(self):
2528
2534
""" .encode ('UTF-8' ))
2529
2535
2530
2536
vl = QgsVectorLayer ("url='http://" + endpoint + "' typename='my:typename' version='1.0.0'" , 'test' , 'WFS' )
2531
- assert vl .isValid ()
2537
+ self . assertTrue ( vl .isValid () )
2532
2538
self .assertEqual (vl .wkbType (), QgsWkbTypes .Point )
2533
2539
self .assertEqual (len (vl .fields ()), 1 )
2534
2540
0 commit comments