mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-04 05:04:23 -07:00
Replace privileges_equal() by a comparison
This commit is contained in:
parent
e2b7d0e29b
commit
b195e71e7c
2 changed files with 2 additions and 46 deletions
|
@ -98,33 +98,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(
|
||||
'before_privileges,after_privileges,output',
|
||||
[
|
||||
(
|
||||
{'*.*': ['INSERT', 'UPDATE', 'GRANT'], '`mysql`.*': ['SELECT']},
|
||||
{'*.*': ['INSERT', 'UPDATE', 'GRANT'], '`mysql`.*': ['SELECT']},
|
||||
True
|
||||
),
|
||||
(
|
||||
{'`mysql`.*': ['SELECT'], '`sys`.*': ['SELECT']},
|
||||
{'`mysql`.*': ['SELECT'], '`sys`.*': ['SELECT']},
|
||||
True
|
||||
),
|
||||
(
|
||||
{'`sys`.*': ['SELECT'], '`mysql`.*': ['SELECT']},
|
||||
{'`mysql`.*': ['SELECT'], '`sys`.*': ['SELECT']},
|
||||
True
|
||||
),
|
||||
(
|
||||
{'`mysql`.*': ['UPDATE'], '`sys`.*': ['SELECT']},
|
||||
{'`mysql`.*': ['SELECT'], '`sys`.*': ['SELECT']},
|
||||
False
|
||||
),
|
||||
]
|
||||
)
|
||||
def test_privileges_equal(before_privileges, after_privileges, output):
|
||||
"""Tests privileges_equal function."""
|
||||
assert privileges_equal(before_privileges, after_privileges) == output
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue