Beispiel #1
0
    def test_list_secret_keys(self):
        '''
        Tests if it list secret keys in GPG keychain
        '''
        ret = [{'fingerprint': u'F321F', 'keyid': u'3F0C8E90D459D89A',
                'trust': 'Ultimately Trusted',
                'uids': [u'Autogenerated Key (Generated by SaltStack)']}]

        mock_conf = MagicMock(return_value='')
        mock_user = MagicMock(return_value={'home': 'salt'})
        with patch.dict(gpg.__salt__, {'config.option': mock_conf,
                                       'user.info': mock_user}):
            self.assertListEqual(gpg.list_secret_keys(), ret)
Beispiel #2
0
    def test_list_secret_keys(self):
        '''
        Tests if it list secret keys in GPG keychain
        '''
        ret = [{'fingerprint': u'F321F', 'keyid': u'3F0C8E90D459D89A',
                'trust': 'Ultimately Trusted',
                'uids': [u'Autogenerated Key (Generated by SaltStack)']}]

        mock_conf = MagicMock(return_value='')
        mock_user = MagicMock(return_value={'home': 'salt'})
        with patch.dict(gpg.__salt__, {'config.option': mock_conf,
                                       'user.info': mock_user}):
            self.assertListEqual(gpg.list_secret_keys(), ret)