mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-20 01:11:27 -07:00
Fix unit tests
This commit is contained in:
parent
546703f08b
commit
f4ca2f1497
5 changed files with 87 additions and 32 deletions
|
@ -10,37 +10,10 @@ from ansible_collections.community.mysql.plugins.modules.mysql_user import (
|
|||
has_grant_on_col,
|
||||
normalize_col_grants,
|
||||
sort_column_order,
|
||||
supports_identified_by_password,
|
||||
)
|
||||
from ..utils import dummy_cursor_class
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'function_return,cursor_output,cursor_ret_type',
|
||||
[
|
||||
(True, '5.5.1-mysql', 'list'),
|
||||
(True, '5.7.0-mysql', 'dict'),
|
||||
(True, '10.5.0-mariadb', 'dict'),
|
||||
(True, '10.5.1-mariadb', 'dict'),
|
||||
(True, '10.6.0-mariadb', 'dict'),
|
||||
(True, '11.5.1-mariadb', 'dict'),
|
||||
(False, '8.0.22-mysql', 'list'),
|
||||
(False, '8.1.2-mysql', 'dict'),
|
||||
(False, '9.0.0-mysql', 'list'),
|
||||
(False, '8.0.0-mysql', 'list'),
|
||||
(False, '8.0.11-mysql', 'dict'),
|
||||
(False, '8.0.21-mysql', 'list'),
|
||||
]
|
||||
)
|
||||
def test_supports_identified_by_password(function_return, cursor_output, cursor_ret_type):
|
||||
"""
|
||||
Tests whether 'CREATE USER %s@%s IDENTIFIED BY PASSWORD %s' is supported,
|
||||
which is currently supported by everything besides MySQL >= 8.0.
|
||||
"""
|
||||
cursor = dummy_cursor_class(cursor_output, cursor_ret_type)
|
||||
assert supports_identified_by_password(cursor) == function_return
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'input_list,grant,output_tuple',
|
||||
[
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue