diff options
-rw-r--r-- | slack/weechat_config.py | 7 | ||||
-rw-r--r-- | tests/conftest.py | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/slack/weechat_config.py b/slack/weechat_config.py index 6e6cb85..9c0c098 100644 --- a/slack/weechat_config.py +++ b/slack/weechat_config.py @@ -102,9 +102,12 @@ class WeeChatOption(Generic[WeeChatOptionType]): @value.setter def value(self, value: WeeChatOptionType): - rc = self.value_set_as_str(str(value)) + value_str = ( + str(value).lower() if isinstance(self.default_value, bool) else str(value) + ) + rc = self.value_set_as_str(value_str) if rc == weechat.WEECHAT_CONFIG_OPTION_SET_ERROR: - raise Exception(f"Failed to value for option: {self.name}") + raise Exception(f"Failed to set value for option: {self.name}") def value_set_as_str(self, value: str) -> int: return weechat.config_option_set(self._pointer, value, 1) diff --git a/tests/conftest.py b/tests/conftest.py index d1cf16a..0b3cada 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -88,7 +88,7 @@ def config_option_set(option: str, value: str, run_callback: int) -> int: def config_boolean(option: str) -> int: - return config_values.get(option) == "True" + return config_values.get(option) in ["true", "on", "yes", "y", "true", "t", "1"] def config_integer(option: str) -> int: |