generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mysql_variables: fix boolean value handling (#653)
* mysql_variables: fix boolean value handling * fix * Fix tests * Fix tests * Fix * Fix * Fix * Fix comment
- Loading branch information
1 parent
33e8754
commit 4912f1a
Showing
4 changed files
with
142 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bugfixes: | ||
- mysql_variables - fix the module always changes on boolean values (https://github.com/ansible-collections/community.mysql/issues/652). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |