Fixed RE-SQL test cases failed due to the previous commit.

Introduces a new key - replace_regex_pattern to synchronize the
expected SQL with the backend SQL based on the regex string
This commit is contained in:
Aditya Toshniwal
2020-08-27 19:08:00 +05:30
committed by Akshay Joshi
parent 53a5410337
commit 28b637c99c
3 changed files with 13 additions and 4 deletions

View File

@@ -702,6 +702,12 @@ class ReverseEngineeredSQLTestCases(BaseTestGenerator):
sql = sql.replace(self.JSON_PLACEHOLDERS['password'], password)
if 'replace_regex_pattern' in scenario:
for a_patten in scenario['replace_regex_pattern']:
found = re.findall(a_patten, resp_sql)
if len(found) > 0:
sql = re.sub(a_patten, found[0], sql)
# Replace place holder <owner> with the current username
# used to connect to the database
if 'pga_job_id' in scenario: