-
-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
python3Packages.hatasmota: 0.2.8 -> 0.2.9 #113272
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mweinelt
approved these changes
Feb 16, 2021
FWIW: This update breaks these two tests in the currentt version of the home-assistant package. We are currently not running these tests, but this will change shortly. ________________________ test_transition_fixed[pyloop] _________________________
[gw0] linux -- Python 3.8.8 /nix/store/yl69v76azrz4daiqksrhb8nnmdiqdjg9-python3-3.8.8/bin/python3.8
hass = <homeassistant.core.HomeAssistant object at 0x7fff6dcb24c0>
mqtt_mock = <MagicMock id='140735047756576'>, setup_tasmota = None
async def test_transition_fixed(hass, mqtt_mock, setup_tasmota):
"""Test transition commands."""
config = copy.deepcopy(DEFAULT_CONFIG)
config["rl"][0] = 2
config["lt_st"] = 5 # 5 channel light (RGBCW)
config["so"]["117"] = 1 # fading at fixed duration instead of fixed slew rate
mac = config["mac"]
async_fire_mqtt_message(
hass,
f"{DEFAULT_PREFIX}/{mac}/config",
json.dumps(config),
)
await hass.async_block_till_done()
async_fire_mqtt_message(hass, "tasmota_49A3BC/tele/LWT", "Online")
state = hass.states.get("light.test")
assert state.state == STATE_OFF
await hass.async_block_till_done()
await hass.async_block_till_done()
mqtt_mock.async_publish.reset_mock()
# Dim the light from 0->100: Speed should be 4*2=8
await common.async_turn_on(hass, "light.test", brightness=255, transition=4)
> mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog",
"NoDelay;Fade 1;NoDelay;Speed 8;NoDelay;Dimmer 100",
0,
False,
)
tests/components/tasmota/test_light.py:1104:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nix/store/yl69v76azrz4daiqksrhb8nnmdiqdjg9-python3-3.8.8/lib/python3.8/unittest/mock.py:925: in assert_called_once_with
return self.assert_called_with(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <MagicMock name='mock.async_publish' id='140735048207280'>
args = ('tasmota_49A3BC/cmnd/Backlog', 'NoDelay;Fade 1;NoDelay;Speed 8;NoDelay;Dimmer 100', 0, False)
kwargs = {}
expected = (('tasmota_49A3BC/cmnd/Backlog', 'NoDelay;Fade 1;NoDelay;Speed 8;NoDelay;Dimmer 100', 0, False), {})
actual = call('tasmota_49A3BC/cmnd/Backlog', 'NoDelay;Fade2 1;NoDelay;Speed2 8;NoDelay;Dimmer 100', 0, False)
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7fff74b2eaf0>
cause = None
def assert_called_with(self, /, *args, **kwargs):
"""assert that the last call was made with the specified arguments.
Raises an AssertionError if the args and keyword args passed in are
different to the last call to the mock."""
if self.call_args is None:
expected = self._format_mock_call_signature(args, kwargs)
actual = 'not called.'
error_message = ('expected call not found.\nExpected: %s\nActual: %s'
% (expected, actual))
raise AssertionError(error_message)
def _error_message():
msg = self._format_mock_failure_message(args, kwargs)
return msg
expected = self._call_matcher((args, kwargs))
actual = self._call_matcher(self.call_args)
if expected != actual:
cause = expected if isinstance(expected, Exception) else None
> raise AssertionError(_error_message()) from cause
E AssertionError: expected call not found.
E Expected: async_publish('tasmota_49A3BC/cmnd/Backlog', 'NoDelay;Fade 1;NoDelay;Speed 8;NoDelay;Dimmer 100', 0, False)
E Actual: async_publish('tasmota_49A3BC/cmnd/Backlog', 'NoDelay;Fade2 1;NoDelay;Speed2 8;NoDelay;Dimmer 100', 0, False)
/nix/store/yl69v76azrz4daiqksrhb8nnmdiqdjg9-python3-3.8.8/lib/python3.8/unittest/mock.py:913: AssertionError ________________________ test_transition_fixed[pyloop] _________________________
[gw0] linux -- Python 3.8.8 /nix/store/yl69v76azrz4daiqksrhb8nnmdiqdjg9-python3-3.8.8/bin/python3.8
hass = <homeassistant.core.HomeAssistant object at 0x7fff6dcb24c0>
mqtt_mock = <MagicMock id='140735047756576'>, setup_tasmota = None
async def test_transition_fixed(hass, mqtt_mock, setup_tasmota):
"""Test transition commands."""
config = copy.deepcopy(DEFAULT_CONFIG)
config["rl"][0] = 2
config["lt_st"] = 5 # 5 channel light (RGBCW)
config["so"]["117"] = 1 # fading at fixed duration instead of fixed slew rate
mac = config["mac"]
async_fire_mqtt_message(
hass,
f"{DEFAULT_PREFIX}/{mac}/config",
json.dumps(config),
)
await hass.async_block_till_done()
async_fire_mqtt_message(hass, "tasmota_49A3BC/tele/LWT", "Online")
state = hass.states.get("light.test")
assert state.state == STATE_OFF
await hass.async_block_till_done()
await hass.async_block_till_done()
mqtt_mock.async_publish.reset_mock()
# Dim the light from 0->100: Speed should be 4*2=8
await common.async_turn_on(hass, "light.test", brightness=255, transition=4)
> mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog",
"NoDelay;Fade 1;NoDelay;Speed 8;NoDelay;Dimmer 100",
0,
False,
)
tests/components/tasmota/test_light.py:1104:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nix/store/yl69v76azrz4daiqksrhb8nnmdiqdjg9-python3-3.8.8/lib/python3.8/unittest/mock.py:925: in assert_called_once_with
return self.assert_called_with(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <MagicMock name='mock.async_publish' id='140735048207280'>
args = ('tasmota_49A3BC/cmnd/Backlog', 'NoDelay;Fade 1;NoDelay;Speed 8;NoDelay;Dimmer 100', 0, False)
kwargs = {}
expected = (('tasmota_49A3BC/cmnd/Backlog', 'NoDelay;Fade 1;NoDelay;Speed 8;NoDelay;Dimmer 100', 0, False), {})
actual = call('tasmota_49A3BC/cmnd/Backlog', 'NoDelay;Fade2 1;NoDelay;Speed2 8;NoDelay;Dimmer 100', 0, False)
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7fff74b2eaf0>
cause = None
def assert_called_with(self, /, *args, **kwargs):
"""assert that the last call was made with the specified arguments.
Raises an AssertionError if the args and keyword args passed in are
different to the last call to the mock."""
if self.call_args is None:
expected = self._format_mock_call_signature(args, kwargs)
actual = 'not called.'
error_message = ('expected call not found.\nExpected: %s\nActual: %s'
% (expected, actual))
raise AssertionError(error_message)
def _error_message():
msg = self._format_mock_failure_message(args, kwargs)
return msg
expected = self._call_matcher((args, kwargs))
actual = self._call_matcher(self.call_args)
if expected != actual:
cause = expected if isinstance(expected, Exception) else None
> raise AssertionError(_error_message()) from cause
E AssertionError: expected call not found.
E Expected: async_publish('tasmota_49A3BC/cmnd/Backlog', 'NoDelay;Fade 1;NoDelay;Speed 8;NoDelay;Dimmer 100', 0, False)
E Actual: async_publish('tasmota_49A3BC/cmnd/Backlog', 'NoDelay;Fade2 1;NoDelay;Speed2 8;NoDelay;Dimmer 100', 0, False)
/nix/store/yl69v76azrz4daiqksrhb8nnmdiqdjg9-python3-3.8.8/lib/python3.8/unittest/mock.py:913: AssertionError |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for this change
Update to latest upstream release 0.2.9
Change log: https://github.com/emontnemery/hatasmota/releases/tag/0.2.9
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)