Exemple #1
0
async def test_disable_log_integration_side_effect_error(loop):
    with patch("opentrons.config.advanced_settings.log_control") \
            as mock_log_control:

        async def set_syslog_level(level):
            return 1, "", ""

        mock_log_control.set_syslog_level.side_effect = set_syslog_level
        with patch("opentrons.config.advanced_settings.ARCHITECTURE",
                   new=advanced_settings.ARCHITECTURE.BUILDROOT):
            s = advanced_settings.DisableLogIntegrationSettingDefinition()
            with pytest.raises(advanced_settings.SettingException):
                await s.on_change(True)
Exemple #2
0
async def test_disable_log_integration_side_effect(loop, v, expected_level):
    with patch("opentrons.config.advanced_settings.log_control") \
            as mock_log_control:

        async def set_syslog_level(level):
            return 0, "", ""

        mock_log_control.set_syslog_level.side_effect = set_syslog_level
        with patch("opentrons.config.advanced_settings.ARCHITECTURE",
                   new=advanced_settings.ARCHITECTURE.BUILDROOT):
            s = advanced_settings.DisableLogIntegrationSettingDefinition()
            await s.on_change(v)
            mock_log_control.set_syslog_level.assert_called_once_with(
                expected_level)