mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-18 16:31:26 -07:00
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:
parent
33e8754c4e
commit
4912f1a41b
4 changed files with 142 additions and 0 deletions
26
tests/unit/plugins/modules/test_mysql_variables.py
Normal file
26
tests/unit/plugins/modules/test_mysql_variables.py
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue