Skip to content

Commit af06cf0

Browse files
committedMar 21, 2019
[processing] Fix exception when creating unit tests
1 parent c7ac866 commit af06cf0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎python/plugins/processing/gui/TestTools.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,14 @@ def splitAlgIdAndParameters(command):
135135
"""
136136
exp = re.compile(r"""['"](.*?)['"]\s*,\s*(.*)""")
137137
m = exp.search(command[len('processing.run('):-1])
138-
return m.group(1), ast.literal_eval(m.group(2))
138+
alg_id = m.group(1)
139+
params = m.group(2)
140+
141+
# replace QgsCoordinateReferenceSystem('EPSG:4325') with just string value
142+
exp = re.compile(r"""QgsCoordinateReferenceSystem\((['"].*?['"])\)""")
143+
params = exp.sub('\\1', params)
144+
145+
return alg_id, ast.literal_eval(params)
139146

140147

141148
def createTest(text):

0 commit comments

Comments
 (0)
Please sign in to comment.