mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-02 20:24:24 -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():
|
def test_start_group_replication_fail():
|
||||||
"""Test startgroupreplication function with failure."""
|
"""Test startgroupreplication function with failure."""
|
||||||
from ansible_collections.community.mysql.plugins.modules.mysql_replication import startgroupreplication
|
from ansible_collections.community.mysql.plugins.modules.mysql_replication import startgroupreplication
|
||||||
import pymysql
|
|
||||||
|
|
||||||
cursor = MockCursor(status="ERROR")
|
cursor = MockCursor(status="ERROR")
|
||||||
module = type('obj', (object,), {
|
module = type('obj', (object,), {
|
||||||
'fail_json': lambda msg: None,
|
'fail_json': lambda msg: None,
|
||||||
})
|
})
|
||||||
|
|
||||||
# Mock the Warning exception
|
|
||||||
pymysql.Warning = Exception
|
|
||||||
|
|
||||||
result = startgroupreplication(module, cursor, [], True)
|
result = startgroupreplication(module, cursor, [], True)
|
||||||
|
|
||||||
assert result is False
|
assert result is False
|
||||||
|
@ -104,16 +100,12 @@ def test_start_group_replication_fail():
|
||||||
def test_stop_group_replication_fail():
|
def test_stop_group_replication_fail():
|
||||||
"""Test stopgroupreplication function with failure."""
|
"""Test stopgroupreplication function with failure."""
|
||||||
from ansible_collections.community.mysql.plugins.modules.mysql_replication import stopgroupreplication
|
from ansible_collections.community.mysql.plugins.modules.mysql_replication import stopgroupreplication
|
||||||
import pymysql
|
|
||||||
|
|
||||||
cursor = MockCursor(status="ERROR")
|
cursor = MockCursor(status="ERROR")
|
||||||
module = type('obj', (object,), {
|
module = type('obj', (object,), {
|
||||||
'fail_json': lambda msg: None,
|
'fail_json': lambda msg: None,
|
||||||
})
|
})
|
||||||
|
|
||||||
# Mock the Warning exception
|
|
||||||
pymysql.Warning = Exception
|
|
||||||
|
|
||||||
result = stopgroupreplication(module, cursor, True)
|
result = stopgroupreplication(module, cursor, True)
|
||||||
|
|
||||||
assert result is False
|
assert result is False
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue