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
461efe61fe
commit
1439274e15
2 changed files with 8 additions and 4 deletions
|
@ -16,6 +16,8 @@ class MockCursor:
|
|||
self.executed_queries = []
|
||||
|
||||
def execute(self, query):
|
||||
if self.status == "ERROR":
|
||||
raise Exception("Mocked execution error")
|
||||
self.executed_queries.append(query)
|
||||
|
||||
def fetchone(self):
|
||||
|
@ -44,7 +46,7 @@ def test_uses_replica_terminology(f_output, c_output, c_ret_type):
|
|||
(None, None, "START GROUP_REPLICATION "),
|
||||
("repl_user", None, "START GROUP_REPLICATION USER='repl_user'"),
|
||||
(None, "repl_pass", "START GROUP_REPLICATION PASSWORD='repl_pass'"),
|
||||
("repl_user", "repl_pass", "START GROUP_REPLICATION USER='repl_user', PASSWORD='repl_pass'"),
|
||||
("repl_user", "repl_pass", "START GROUP_REPLICATION USER='repl_user',PASSWORD='repl_pass'"),
|
||||
]
|
||||
)
|
||||
def test_start_group_replication(user, password, expected_query):
|
||||
|
@ -58,9 +60,9 @@ def test_start_group_replication(user, password, expected_query):
|
|||
|
||||
chm = []
|
||||
if user:
|
||||
chm.append(" USER='%s'" % user)
|
||||
chm.append("USER='%s'" % user)
|
||||
if password:
|
||||
chm.append(" PASSWORD='%s'" % password)
|
||||
chm.append("PASSWORD='%s'" % password)
|
||||
|
||||
result = startgroupreplication(module, cursor, chm, False)
|
||||
|
||||
|
|
|
@ -16,6 +16,8 @@ class MockCursor:
|
|||
self.executed_queries = []
|
||||
|
||||
def execute(self, query):
|
||||
if self.status == "ERROR":
|
||||
raise Exception("Mocked execution error")
|
||||
self.executed_queries.append(query)
|
||||
|
||||
def fetchone(self):
|
||||
|
@ -48,7 +50,7 @@ def test_uses_replica_terminology(f_output, c_output, c_ret_type):
|
|||
(None, None, "START GROUP_REPLICATION "),
|
||||
("repl_user", None, "START GROUP_REPLICATION USER='repl_user'"),
|
||||
(None, "repl_pass", "START GROUP_REPLICATION PASSWORD='repl_pass'"),
|
||||
("repl_user", "repl_pass", "START GROUP_REPLICATION USER='repl_user', PASSWORD='repl_pass'"),
|
||||
("repl_user", "repl_pass", "START GROUP_REPLICATION USER='repl_user',PASSWORD='repl_pass'"),
|
||||
]
|
||||
)
|
||||
def test_start_group_replication(user, password, expected_query):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue