5
sys.modules['MySQLdb'] = mock.Mock()
10
class CommonTests(unittest.TestCase):
12
@mock.patch.object(common, 'MySQLHelper', spec=common.MySQLHelper)
13
def test_get_db_helper(self, mock_helper):
14
common.get_db_helper()
15
kwargs = {'rpasswdf_template': '/var/lib/mysql/mysql.passwd',
16
'upasswdf_template': '/var/lib/mysql/mysql-{}.passwd',
17
'delete_ondisk_passwd_file': False}
18
mock_helper.assert_called_with(**kwargs)