-
Notifications
You must be signed in to change notification settings - Fork 1
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
95 bugfix/form not hyperlinked #96
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding fake node data to test_bot_telegram.py
and test_bot_slack.py
I think it may be better if we use Edit: I just did this with |
tests/test_bot_telegram.py
Outdated
## Create a fake node model | ||
fakenode = ic_api.Node( | ||
dc_id = 'fake_dc_id', | ||
dc_name = 'fake_dc_name', | ||
node_id = 'fake_node_id', | ||
node_operator_id = 'fake_node_operator_id', | ||
node_provider_id = 'fake_node_provider_id', | ||
node_provider_name = 'fake_node_provider_name', | ||
owner = 'fake_owner', | ||
region = 'fake_region', | ||
status = 'DOWN', | ||
subnet_id = 'fake_subnet_id', | ||
) | ||
fakelabel = {'fake_node_id': 'fake_label'} | ||
|
||
with patch.object(c, 'FEEDBACK_FORM_URL', 'https://url-has-been-redacted.ninja'): | ||
subject1, message1 = messages.nodes_down_message([fakenode], fakelabel) | ||
subject2, message2 = messages.nodes_status_message([fakenode], fakelabel) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're repeating this code 3 times.
I suggest one of:
- We test sending a short simple string in both
test_bot_slack.py
andtest_bot_telegram.py
like before, and use only the public inbox to make sure the messages look like how we want them. Keep the codebase a bit smaller. - We move this logic outside of these test functions, compute once and store it in
conftest.py
. - Leave as is.
I'm kind of in favor of option 1. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get rid of any of these unused imports? Specifically the ones in test_bot_slack and test_bot_telegram?
Fixes #95
Description
Include a link to a feedback form in all messages sent from Node Monitor.
Changes made
messages.py
.test_bot_telegram
andtest_bot_slack
to use message templates when sending live messages during testing.Testing
Additional comments
n/a