mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-04 05:04:23 -07:00
fix warning baseexception class error
This commit is contained in:
parent
4b14ac1b50
commit
12a95c4446
3 changed files with 17 additions and 13 deletions
|
@ -72,10 +72,11 @@ def test_stop_group_replication():
|
|||
def test_start_group_replication_fail():
|
||||
"""Test startgroupreplication function with failure."""
|
||||
from ansible_collections.community.mysql.plugins.modules.mysql_replication import startgroupreplication
|
||||
from ..utils import MockWarning
|
||||
|
||||
# Create a mock mysql_driver with a Warning attribute
|
||||
class MockDriver:
|
||||
Warning = MockCursor.Warning
|
||||
Warning = MockWarning
|
||||
|
||||
# Save the original mysql_driver
|
||||
from ansible_collections.community.mysql.plugins.modules import mysql_replication
|
||||
|
@ -101,10 +102,11 @@ def test_start_group_replication_fail():
|
|||
def test_stop_group_replication_fail():
|
||||
"""Test stopgroupreplication function with failure."""
|
||||
from ansible_collections.community.mysql.plugins.modules.mysql_replication import stopgroupreplication
|
||||
from ..utils import MockWarning
|
||||
|
||||
# Create a mock mysql_driver with a Warning attribute
|
||||
class MockDriver:
|
||||
Warning = MockCursor.Warning
|
||||
Warning = MockWarning
|
||||
|
||||
# Save the original mysql_driver
|
||||
from ansible_collections.community.mysql.plugins.modules import mysql_replication
|
||||
|
|
|
@ -76,10 +76,11 @@ def test_stop_group_replication():
|
|||
def test_start_group_replication_fail():
|
||||
"""Test startgroupreplication function with failure."""
|
||||
from ansible_collections.community.mysql.plugins.modules.mysql_replication import startgroupreplication
|
||||
from ..utils import MockWarning
|
||||
|
||||
# Create a mock mysql_driver with a Warning attribute
|
||||
class MockDriver:
|
||||
Warning = MockCursor.Warning
|
||||
Warning = MockWarning
|
||||
|
||||
# Save the original mysql_driver
|
||||
from ansible_collections.community.mysql.plugins.modules import mysql_replication
|
||||
|
@ -105,10 +106,11 @@ def test_start_group_replication_fail():
|
|||
def test_stop_group_replication_fail():
|
||||
"""Test stopgroupreplication function with failure."""
|
||||
from ansible_collections.community.mysql.plugins.modules.mysql_replication import stopgroupreplication
|
||||
from ..utils import MockWarning
|
||||
|
||||
# Create a mock mysql_driver with a Warning attribute
|
||||
class MockDriver:
|
||||
Warning = MockCursor.Warning
|
||||
Warning = MockWarning
|
||||
|
||||
# Save the original mysql_driver
|
||||
from ansible_collections.community.mysql.plugins.modules import mysql_replication
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue