Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement provider test for GPX provider
A whole lot of base provider tests are not compatible with the GPX provider, as we can't add the required fields.
- Loading branch information
1 parent
4662cc0
commit 3999292
Showing
3 changed files
with
2,742 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
# -*- coding: utf-8 -*- | ||
"""QGIS Unit tests for the GPX provider. | ||
.. note:: This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
""" | ||
__author__ = 'Nyall Dawson' | ||
__date__ = '2021-07-30' | ||
__copyright__ = 'Copyright 2021, The QGIS Project' | ||
|
||
from qgis.core import ( | ||
QgsVectorLayer, | ||
) | ||
from qgis.testing import ( | ||
start_app, | ||
unittest | ||
) | ||
|
||
from providertestbase import ProviderTestCase | ||
from utilities import ( | ||
unitTestDataPath | ||
) | ||
|
||
start_app() | ||
|
||
|
||
class TestPyQgsGpxProvider(unittest.TestCase, ProviderTestCase): | ||
|
||
@classmethod | ||
def createLayer(cls): | ||
vl = QgsVectorLayer( | ||
f'{unitTestDataPath()}/gpx_test_suite.gpx?type=waypoint', | ||
'test', 'gpx') | ||
assert (vl.isValid()) | ||
return vl | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
"""Run before all tests""" | ||
# Create test layer | ||
cls.vl = cls.createLayer() | ||
assert (cls.vl.isValid()) | ||
cls.source = cls.vl.dataProvider() | ||
|
||
@classmethod | ||
def tearDownClass(cls): | ||
"""Run after all tests""" | ||
|
||
@property | ||
def pk_name(self): | ||
"""Return the primary key name, override if different than the default 'pk'""" | ||
return 'comment' | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testGetFeatures(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testGetFeaturesDestinationCrs(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testGetFeaturesLimit(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testGetFeaturesSubsetAttributes(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testGetFeaturesWithGeometry(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testOrderBy(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testRectAndFids(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testCloneLayer(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testExtent(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testFeatureCount(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testGetFeaturesFilterRectTests(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testFields(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testGeomAndAllAttributes(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testGetFeaturesFidTests(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testGetFeaturesFidsTests(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testGetFeaturesSubsetAttributes2(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testGetFeaturesUncompiled(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testMaxValue(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testMaximumValue(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testMinValue(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testMinimumValue(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testRectAndExpression(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testStringComparison(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testUnique(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testUniqueStringsMatching(self): | ||
pass | ||
|
||
@unittest.skip('Base provider test is not suitable for GPX provider') | ||
def testUniqueValues(self): | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
Oops, something went wrong.