mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-07-31 17:11:25 -07:00
fix more tests
This commit is contained in:
parent
7c376590e7
commit
461efe61fe
1 changed files with 0 additions and 8 deletions
|
@ -86,16 +86,12 @@ 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
|
||||
import pymysql
|
||||
|
||||
cursor = MockCursor(status="ERROR")
|
||||
module = type('obj', (object,), {
|
||||
'fail_json': lambda msg: None,
|
||||
})
|
||||
|
||||
# Mock the Warning exception
|
||||
pymysql.Warning = Exception
|
||||
|
||||
result = startgroupreplication(module, cursor, [], True)
|
||||
|
||||
assert result is False
|
||||
|
@ -104,16 +100,12 @@ 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
|
||||
import pymysql
|
||||
|
||||
cursor = MockCursor(status="ERROR")
|
||||
module = type('obj', (object,), {
|
||||
'fail_json': lambda msg: None,
|
||||
})
|
||||
|
||||
# Mock the Warning exception
|
||||
pymysql.Warning = Exception
|
||||
|
||||
result = stopgroupreplication(module, cursor, True)
|
||||
|
||||
assert result is False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue