p!ranha?
Server IP : 103.169.32.36  /  Your IP : 216.73.216.202
Web Server : Apache
System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/doc/pygpgme-0.3/tests/

Upload File :
Curr3nt_D!r [ Writeable ] D0cum3nt_r0Ot [ Writeable ]

 
Command :
Current File : /usr/share/doc/pygpgme-0.3/tests/test_export.py
# pygpgme - a Python wrapper for the gpgme library
# Copyright (C) 2006  James Henstridge
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

import unittest
try:
    from io import BytesIO
except ImportError:
    from StringIO import StringIO as BytesIO
from textwrap import dedent

import gpgme
from tests.util import GpgHomeTestCase

class ExportTestCase(GpgHomeTestCase):

    import_keys = ['signonly.pub', 'signonly.sec']

    def test_export_by_fingerprint(self):
        ctx = gpgme.Context()
        ctx.armor = True
        keydata = BytesIO()
        ctx.export('15E7CE9BF1771A4ABC550B31F540A569CB935A42', keydata)

        self.assertTrue(keydata.getvalue().startswith(
            b'-----BEGIN PGP PUBLIC KEY BLOCK-----\n'))

    def test_export_by_email(self):
        ctx = gpgme.Context()
        ctx.armor = True
        keydata = BytesIO()
        ctx.export('signonly@example.org', keydata)

        self.assertTrue(keydata.getvalue().startswith(
            b'-----BEGIN PGP PUBLIC KEY BLOCK-----\n'))

    def test_export_by_name(self):
        ctx = gpgme.Context()
        ctx.armor = True
        keydata = BytesIO()
        ctx.export('Sign Only', keydata)

        self.assertTrue(keydata.getvalue().startswith(
            b'-----BEGIN PGP PUBLIC KEY BLOCK-----\n'))


def test_suite():
    loader = unittest.TestLoader()
    return loader.loadTestsFromName(__name__)
N4m3
5!z3
L45t M0d!f!3d
0wn3r / Gr0up
P3Rm!55!0n5
0pt!0n5
..
--
December 20 2023 04:36:15
0 / 0
0755
keys
--
December 20 2023 04:36:15
0 / 0
0755
__init__.py
1.851 KB
February 27 2012 15:17:18
0 / 0
0644
test_context.py
5.275 KB
March 02 2012 04:16:48
0 / 0
0644
test_delete.py
2.272 KB
February 28 2012 06:10:07
0 / 0
0644
test_editkey.py
3.313 KB
February 29 2012 03:04:43
0 / 0
0644
test_encrypt_decrypt.py
8.333 KB
February 29 2012 03:10:28
0 / 0
0644
test_export.py
2.021 KB
March 02 2012 06:28:49
0 / 0
0644
test_genkey.py
3.759 KB
March 02 2012 06:41:09
0 / 0
0644
test_import.py
7.518 KB
March 02 2012 04:22:58
0 / 0
0644
test_keylist.py
2.761 KB
February 27 2012 15:17:18
0 / 0
0644
test_keys.py
12.078 KB
February 27 2012 15:17:18
0 / 0
0644
test_passphrase.py
2.949 KB
February 29 2012 03:04:17
0 / 0
0644
test_progress.py
1.939 KB
February 28 2012 06:03:22
0 / 0
0644
test_sign_verify.py
12.97 KB
February 29 2012 03:09:36
0 / 0
0644
util.py
1.692 KB
March 02 2012 04:20:23
0 / 0
0644