Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encode json output before writing test data #215

Merged
merged 2 commits into from
Jun 3, 2021

Conversation

vbisserie
Copy link

Signed-off-by: Vincent Bisserie vincent.bisserie@renault.com
Running python test_rule.py --days 1 --save-json bar.json ./rules/bar.yaml raises the following exception :

Traceback (most recent call last):
  File "/home/foo/elastalert/test_rule.py", line 455, in main
    test_instance.run_rule_test()
  File "/home/foo/elastalert/test_rule.py", line 437, in run_rule_test
    data_file.write(json.dumps([doc['_source'] for doc in hits], indent=4))
TypeError: a bytes-like object is required, not 'str'

Vincent Bisserie and others added 2 commits June 3, 2021 15:18
@jertel jertel merged commit 187903b into jertel:master Jun 3, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants