From: asteroide Date: Fri, 18 Sep 2015 10:19:10 +0000 (+0200) Subject: Change the way the data strings are replaced to allow similar variables on the same... X-Git-Tag: colorado.1.0~152^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=667bcc34cf1db96dbf28aa50a65f365e0dc829e7;p=moon.git Change the way the data strings are replaced to allow similar variables on the same line. Change-Id: I0ba5f0151ebc144015196b758c1bde587da63e7b --- diff --git a/moonclient/moonclient/tests.py b/moonclient/moonclient/tests.py index 63f1ed14..1e1020bf 100644 --- a/moonclient/moonclient/tests.py +++ b/moonclient/moonclient/tests.py @@ -33,7 +33,7 @@ class TestsLaunch(Lister): def __replace_var_in_str(self, data_str): for exp in re.findall("\$\w+", data_str): if exp.replace("$", "") in self.result_vars: - data_str = data_str.replace(exp, self.result_vars[exp.replace("$", "")]) + data_str = re.sub(exp.replace("$", "\$") + "(?=$|\s)", self.result_vars[exp.replace("$", "")], data_str) return data_str def __compare_results(self, expected, observed):