mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Wrote test for broken server connection
This commit is contained in:
parent
c6c3ff02e3
commit
180099ae9f
1 changed files with 11 additions and 0 deletions
|
@ -269,6 +269,17 @@ class MySQLTestCase(TestCase):
|
|||
'''
|
||||
self._test_call(mysql.get_slave_status, 'SHOW SLAVE STATUS')
|
||||
|
||||
def test_get_slave_status_bad_server(self):
|
||||
'''
|
||||
Test get_slave_status in the mysql execution module, simulating a broken server
|
||||
'''
|
||||
connect_mock = MagicMock(return_value=None)
|
||||
mysql._connect = connect_mock
|
||||
with patch.dict(mysql.__salt__, {'config.option': MagicMock()}):
|
||||
rslt = mysql.get_slave_status()
|
||||
connect_mock.assert_has_calls([call()])
|
||||
self.assertEqual(rslt, [])
|
||||
|
||||
@skipIf(True, 'MySQL module claims this function is not ready for production')
|
||||
def test_free_slave(self):
|
||||
pass
|
||||
|
|
Loading…
Add table
Reference in a new issue