コード例 #1
0
ファイル: test_auth.py プロジェクト: MalloZup/salt-2
 def setUp(self):  # pylint: disable=W0221
     patches = (
         ('salt.payload.Serial', None),
         ('salt.loader.auth', dict(return_value={'pam.auth': 'fake_func_str', 'pam.groups': 'fake_groups_function_str'})),
         ('salt.loader.eauth_tokens', dict(return_value={'localfs.mk_token': 'fake_func_mktok',
                                                         'localfs.get_token': 'fake_func_gettok',
                                                         'localfs.rm_roken': 'fake_func_rmtok'}))
     )
     for mod, mock in patches:
         if mock:
             patcher = patch(mod, **mock)
         else:
             patcher = patch(mod)
         patcher.start()
         self.addCleanup(patcher.stop)
     self.lauth = auth.LoadAuth({})  # Load with empty opts
コード例 #2
0
 def setUp(self, auth_mock, serial_mock):  # pylint: disable=W0221
     self.lauth = auth.LoadAuth({})  # Load with empty opts