Skip to content

Commit

Permalink
[processing] Fix exception when creating unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 21, 2019
1 parent c7ac866 commit af06cf0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion python/plugins/processing/gui/TestTools.py
Expand Up @@ -135,7 +135,14 @@ def splitAlgIdAndParameters(command):
""" """
exp = re.compile(r"""['"](.*?)['"]\s*,\s*(.*)""") exp = re.compile(r"""['"](.*?)['"]\s*,\s*(.*)""")
m = exp.search(command[len('processing.run('):-1]) 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): def createTest(text):
Expand Down

0 comments on commit af06cf0

Please sign in to comment.