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

python3Packages.hatasmota: 0.2.8 -> 0.2.9 #113272

Merged
merged 1 commit into from
Feb 16, 2021
Merged

Conversation

fabaff
Copy link
Member

@fabaff fabaff commented Feb 16, 2021

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
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@r-rmcgibbo
Copy link

r-rmcgibbo commented Feb 16, 2021

Result of nixpkgs-review pr 113272 at 8366f03 run on x86_64-linux 1

3 packages built:

Result of nixpkgs-review pr 113272 at 8366f03 run on aarch64-linux 1

3 packages built:

@mweinelt mweinelt merged commit 70ce118 into NixOS:master Feb 16, 2021
@mweinelt
Copy link
Member

mweinelt commented Mar 2, 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

@fabaff fabaff deleted the bump-hatasmota branch March 2, 2021 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants