-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Cleanup use of MQTT in emulated_hue tests #4068
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
Conversation
This commit switches the test_emulated_hue module to use unix newlines instead of the DOS style that were there before. (using dos2unix on the file) This makes it consistent with the other files in the repo.
@mtreinish, thanks for your PR! By analyzing the history of the files in this pull request, we identified @mgbowen and @fabaff to be potential reviewers. |
|
||
from homeassistant import bootstrap, const, core | ||
import homeassistant.components as core_components | ||
from homeassistant.components import emulated_hue, http, light, mqtt |
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.
- 1: F401 'homeassistant.components.mqtt' imported but unused
|
||
|
||
|
||
def setup_hass_instance(emulated_hue_config): |
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.
- 1: E303 too many blank lines (3)
data = {'key1': 'value1', 'key2': 'value2'} | ||
result = requests.put( | ||
BRIDGE_URL_BASE.format( | ||
'/api/username/lights/{}/state'.format("light.ceiling_lights")), |
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.
- 80: E501 line too long (80 > 79 characters)
"""Test the allowed methods.""" | ||
result = requests.get( | ||
BRIDGE_URL_BASE.format( | ||
'/api/username/lights/{}/state'.format("light.ceiling_lights"))) |
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.
- 80: E501 line too long (80 > 79 characters)
# Test proper on value parsing | ||
result = requests.put( | ||
BRIDGE_URL_BASE.format( | ||
'/api/username/lights/{}/state'.format("light.ceiling_lights")), |
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.
- 80: E501 line too long (80 > 79 characters)
# Test proper brightness value parsing | ||
result = requests.put( | ||
BRIDGE_URL_BASE.format( | ||
'/api/username/lights/{}/state'.format("light.ceiling_lights")), |
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.
- 80: E501 line too long (80 > 79 characters)
self.assertEqual(result.status_code, 400) | ||
|
||
def perform_put_test_on_ceiling_lights(self, | ||
content_type='application/json'): |
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.
- 42: E128 continuation line under-indented for visual indent
Previously these tests relied on the mqtt light platform as test devices to control with the emulated hue. However, this was pretty heavyweight and required running an MQTT broker in the tests. Instead this commit switches it to use the demo light platform which is strictly in memory. Fixes home-assistant#3549
Oops, forgot to run the lint checks before I pushed it. The new rev should fix the issues |
Yes! Thanks so much 🐬 |
Description:
Previously these tests relied on the mqtt light platform as test devices
to control with the emulated hue. However, this was pretty heavyweight
and required running an MQTT broker in the tests. Instead this commit
switches it to use the demo light platform which is strictly in memory
Related issue (if applicable): fixes #3549
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>
Example entry for
configuration.yaml
(if applicable):Checklist:
If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass