Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[processing] Fix exception when creating unit tests
- Loading branch information
Showing
with
8 additions
and
1 deletion.
-
+8
−1
python/plugins/processing/gui/TestTools.py
|
@@ -135,7 +135,14 @@ def splitAlgIdAndParameters(command): |
|
|
""" |
|
|
exp = re.compile(r"""['"](.*?)['"]\s*,\s*(.*)""") |
|
|
m = exp.search(command[len('processing.run('):-1]) |
|
|
return m.group(1), ast.literal_eval(m.group(2)) |
|
|
alg_id = m.group(1) |
|
|
params = m.group(2) |
|
|
|
|
|
# replace QgsCoordinateReferenceSystem('EPSG:4325') with just string value |
|
|
exp = re.compile(r"""QgsCoordinateReferenceSystem\((['"].*?['"])\)""") |
|
|
params = exp.sub('\\1', params) |
|
|
|
|
|
return alg_id, ast.literal_eval(params) |
|
|
|
|
|
|
|
|
def createTest(text): |
|
|