Revert "sync fork with upstream main"

This reverts commit 77593b7a91e8d417eead0d3d5366ba991c767565.
I imported PR569 to be able to test on my fork, but to avoid polluting
this patch I now revert those commit.
This commit is contained in:
Laurent Indermuehle 2023-10-10 11:01:59 +02:00
parent d38caa264f
commit 5477603583
No known key found for this signature in database
GPG key ID: 93FA944C9F34DD09
17 changed files with 56 additions and 437 deletions

View file

@ -9,8 +9,7 @@ from ansible_collections.community.mysql.plugins.module_utils.user import (
handle_grant_on_col,
has_grant_on_col,
normalize_col_grants,
sort_column_order,
privileges_unpack,
sort_column_order
)
@ -93,21 +92,3 @@ def test_handle_grant_on_col(privileges, start, end, output):
def test_normalize_col_grants(input_, expected):
"""Tests normalize_col_grants function."""
assert normalize_col_grants(input_) == expected
@pytest.mark.parametrize(
'priv,expected,mode,column_case_sensitive,ensure_usage',
[
('mydb.*:SELECT', {'"mydb".*': ['SELECT']}, 'ANSI', False, False),
('mydb.*:SELECT', {'`mydb`.*': ['SELECT']}, 'NOTANSI', False, False),
('mydb.*:SELECT', {'"mydb".*': ['SELECT'], '*.*': ['USAGE']}, 'ANSI', False, True),
('mydb.*:SELECT', {'`mydb`.*': ['SELECT'], '*.*': ['USAGE']}, 'NOTANSI', False, True),
('mydb.*:SELECT (a)', {'`mydb`.*': ['SELECT (A)']}, 'NOTANSI', False, False),
('mydb.*:UPDATE (b, a)', {'`mydb`.*': ['UPDATE (a, b)']}, 'NOTANSI', True, False),
('mydb.*:SELECT (b, a, c)', {'`mydb`.*': ['SELECT (A, B, C)']}, 'NOTANSI', False, False),
('mydb.*:SELECT (b, a, c)', {'`mydb`.*': ['SELECT (a, b, c)']}, 'NOTANSI', True, False),
]
)
def test_privileges_unpack(priv, mode, column_case_sensitive, ensure_usage, expected):
"""Tests privileges_unpack function."""
assert privileges_unpack(priv, mode, column_case_sensitive, ensure_usage) == expected