Skip to content

Commit

Permalink
read test result from testing_result col
Browse files Browse the repository at this point in the history
  • Loading branch information
Olament committed Feb 24, 2021
1 parent 6ec824e commit d6df43d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions ftw_compatible_tool/web_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,12 @@ def execute():
json_result = []
conn = sqlite3.connect(result_name)
c = conn.cursor()
c.execute('SELECT test_title, output FROM Traffic')
c.execute('SELECT test_title, testing_result FROM Traffic')
for row in c:
test_title, output = row
# this is necessary because output col in db use
# single quotation mark, which is not a valid json format
output = output.replace("\'", "\"")
payload = json.loads(output)
test_title, testing_result = row
payload = {}
payload['title'] = test_title
payload['result'] = testing_result
json_result.append(payload)

# clean up
Expand Down

0 comments on commit d6df43d

Please sign in to comment.