From ee18400a33ac38d88379482374ed18d1ff4130f0 Mon Sep 17 00:00:00 2001 From: chris meyers Date: Tue, 14 Apr 2020 10:44:02 -0400 Subject: [PATCH] ensure last comma removed in select * We strip out the json select fields in our tests since it is an sql lite database underneath. Ideally, we would do something fancier, but we aren't. In doing this stipping, we could strip the last element in the projection list. This would result in an extra dangling comma. This commit removes the danging comma in the projection list after the removal of JSON projections. --- awx/main/tests/functional/analytics/test_collectors.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/awx/main/tests/functional/analytics/test_collectors.py b/awx/main/tests/functional/analytics/test_collectors.py index bf470df574..21a243c907 100644 --- a/awx/main/tests/functional/analytics/test_collectors.py +++ b/awx/main/tests/functional/analytics/test_collectors.py @@ -36,6 +36,8 @@ def sqlite_copy_expert(request): for line in sql.split('\n'): if line.find('main_jobevent.event_data::') == -1: sql_new.append(line) + elif not line.endswith(','): + sql_new[-1] = sql_new[-1].rstrip(',') sql = '\n'.join(sql_new) self.execute(sql)