~viswesn/charms/trusty/mysql/lint

« back to all changes in this revision

Viewing changes to unit_tests/test_mysql_common.py

  • Committer: Jorge Niedbalski
  • Date: 2015-02-27 16:18:40 UTC
  • mfrom: (140.1.2 mysql)
  • Revision ID: jorge.niedbalski@canonical.com-20150227161840-oxdi2rnx5qnkomi1
[hopem, r=niedbalski, billy-olsen] Fixes bug LP: #1425999

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import mock
 
2
import unittest
 
3
import sys
 
4
 
 
5
sys.modules['MySQLdb'] = mock.Mock()
 
6
 
 
7
import common  # noqa
 
8
 
 
9
 
 
10
class CommonTests(unittest.TestCase):
 
11
 
 
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)