mysql_variables: fix boolean value handling (#653)

* mysql_variables: fix boolean value handling

* fix

* Fix tests

* Fix tests

* Fix

* Fix

* Fix

* Fix comment
This commit is contained in:
Andrew Klychkov 2024-06-28 11:34:59 +02:00 committed by GitHub
parent 33e8754c4e
commit 4912f1a41b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 142 additions and 0 deletions

View file

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import pytest
from ansible_collections.community.mysql.plugins.modules.mysql_variables import (
convert_bool_setting_value_wanted,
)
@pytest.mark.parametrize(
'value,output',
[
(1, 'ON'),
(0, 'OFF'),
(2, 2),
('on', 'ON'),
('off', 'OFF'),
('ON', 'ON'),
('OFF', 'OFF'),
]
)
def test_convert_bool_value(value, output):
assert convert_bool_setting_value_wanted(value) == output