Class: QgsTestUtils¶
List of all members, including inherited members
Constructor
|
Static Methods
Compares two DOM elements and returns |
|
Sanitizes fake_qgis_http_endpoint URLs |
|
Runs a concurrent access stress test on the layer uri from the provider providerKey, by concurrently opening, reading and closing vector layers and querying the sublayers of the URI from multiple threads for runTimeMs milliseconds. |
|
Runs a thready safety test on iterators from a vector data provider, by concurrently requesting features from the provider. |
- class qgis.core.QgsTestUtils[source]¶
- class qgis.core.QgsTestUtils(a0: QgsTestUtils)
Bases:
object- static compareDomElements(element1: QDomElement, element2: QDomElement) bool[source]¶
Compares two DOM elements and returns
Trueif they are equivalent.Dumps useful diff information to the console if the elements differ.
- Parameters:
element1 (QDomElement)
element2 (QDomElement)
- Return type:
bool
- static sanitizeFakeHttpEndpoint(urlString: str | None) str[source]¶
Sanitizes fake_qgis_http_endpoint URLs
- Parameters:
urlString (str|None)
- Return type:
str
- static testConcurrentLayerAccess(uri: str | None, providerKey: str | None, runTimeMs: int = 2000, timeoutMs: int = 60000) bool[source]¶
Runs a concurrent access stress test on the layer
urifrom the providerproviderKey, by concurrently opening, reading and closing vector layers and querying the sublayers of the URI from multiple threads forrunTimeMsmilliseconds.Returns
Falseif any of the involved threads failed to finish withintimeoutMsmilliseconds (i.e. a deadlock occurred), or if the concurrent layer opens and sublayer queries did not return the same results as when performed from a single thread.- Parameters:
uri (str|None)
providerKey (str|None)
runTimeMs (int = 2000)
timeoutMs (int = 60000)
- Return type:
bool
- static testProviderIteratorThreadSafety(provider: QgsVectorDataProvider | None, request: QgsFeatureRequest = QgsFeatureRequest()) bool[source]¶
Runs a thready safety test on iterators from a vector data
provider, by concurrently requesting features from the provider.This method returns
True… or it segfaults.- Parameters:
provider (QgsVectorDataProvider|None)
request (
QgsFeatureRequest= QgsFeatureRequest())
- Return type:
bool