Skip to content

Commit

Permalink
Merge pull request #215 from vbisserie/dev/encode_before_write
Browse files Browse the repository at this point in the history
Encode json output before writing test data
  • Loading branch information
jertel authored Jun 3, 2021
2 parents fc35ef3 + 152d18a commit 187903b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion elastalert/test_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ def run_rule_test(self):
with open(args.save, 'wb') as data_file:
# Add _id to _source for dump
[doc['_source'].update({'_id': doc['_id']}) for doc in hits]
data_file.write(json.dumps([doc['_source'] for doc in hits], indent=4))
data_file.write(str.encode(json.dumps([doc['_source'] for doc in hits], indent=4)))
if args.use_downloaded:
if hits:
args.json = args.save
Expand Down

0 comments on commit 187903b

Please sign in to comment.