Commit Graph

58 Commits (cf4d3efd8d37e5cac626137a360e0a5d1e8cc49c)

Author SHA1 Message Date
Isis Lovecruft cf4d3efd8d
Merge branch 'fix/94-encrypt-from-stream' into develop 2015-03-13 03:48:49 +00:00
Isis Lovecruft b7ff69092a
Avoid writing to /tmp and borking terminals in regression test from #94. 2015-03-13 03:47:42 +00:00
Isis Lovecruft 79285c4c17
Add @doktorstick's example code for reproducing #93 as a unittest.
* ADD regression test for #93.
2015-03-13 03:45:20 +00:00
Isis Lovecruft 6d1890389c
Actually check output file contents in to test_encrypt_*() tests.
This provides more accurate testing for issues like #93.
2015-03-13 03:44:12 +00:00
Isis Lovecruft 38685ae001
Add @doktorstick's example code for reproducing Issue #93 as a test. 2015-03-13 03:18:52 +00:00
Isis Lovecruft b970917701
Fix multiple encoding errors in tests. 2015-03-13 02:32:51 +00:00
Isis Lovecruft 782a81b46a
Split encryption tests for file-like objects into multiple tests.
This modifies the tests added in #89.
2015-03-13 02:32:50 +00:00
Isis Lovecruft af403fe144
Move 'test_recv_keys_default' to a new test group which doesn't run.
* FIXES #99 temporarily.
2015-03-13 02:25:10 +00:00
Isis Lovecruft f858080148
Merge remote-tracking branch 'charles-dyfis-net/pass_through_good_options' into develop 2015-03-09 07:24:38 +00:00
Garrett Robinson 6c15f25ee5 Unit test for encrypting file-like objects 2015-01-20 11:18:55 -08:00
Isis Lovecruft 81b2d9d9c2
Change ListPackets.key to be backwards compatible.
This also adds a new ``ListPackets.encrypted_to`` list, which contains
all the keyids which a message was encrypted to. ``ListPackets.key`` is
just the first one we discovered that it was encrypted to, for backwards
compatibility.

 * FIXES part of Issue #67.
   https://github.com/isislovecruft/python-gnupg/issues/67

 * CHANGES the additions made in commit f70a7dc4f0 by @tomgalloway in
   PR#70 to be backwards compatible.
   f70a7dc4f0
   https://github.com/isislovecruft/python-gnupg/pull/77
2014-11-27 02:35:52 +00:00
Isis Lovecruft 513a48d876
Add throw_keyids=bool option to encrypt() method.
* FIXES part of Issue #67.
   https://github.com/isislovecruft/python-gnupg/issues/67
2014-11-27 02:19:34 +00:00
Isis Lovecruft 09c6a08637 Merge remote-tracking branch 'tomgalloway/develop' into fix/67-hidden-encrypt 2014-11-27 01:18:37 +00:00
Charles Duffy a1c45a6f63 Not sufficient to drop bad options; good ones need to be passed through.
This code was broken: Half of it required `options` to be a string, and the
other half required `options` to be a list (which the tests enforced, but the
constructor would silently drop for normal-path initialization).
2014-11-26 17:43:36 -06:00
Isis Lovecruft fecf92c0ac
Remove expectation for UnicodeDecodeError in a unittest.
It seems that more modern versions of Python (e.g. 2.7.8), doing:

    from __future__ import print_function
    print("SIG=%s" % sig)

with some binary data doesn't actually produce a UnicodeDecodeError,
which means that Python2 is slowly getting less retarded. :D

On the downside, we probably shouldn't have been testing for things
which are Python2.x mis-design issues (and not really our fault, nor a
bug in python-gnupg) anyway.
2014-11-19 03:46:44 +00:00
Tom Galloway f70a7dc4f0 Update to allow multiple keys to be shown on list_packets.
Also updated test to ensure only expected keyid has been hidden.
2014-11-05 12:37:27 +00:00
Tom Galloway 327d2e5f66 Actually add test to be run and format variable correctly. 2014-10-29 14:59:43 +00:00
Tom Galloway df5fdb5aa8 Allow --hidden-recipient to be used for a list of recipients. 2014-10-29 14:47:27 +00:00
Isis Lovecruft f521545903
Merge remote-tracking branch 'anarcat/dev/monkeysign' into develop 2014-09-24 21:12:05 +00:00
Antoine Beaupré 293fa6b2e0
fix truth evaluation of import results
for some reason, the count was accessed as if it was a Storage
instance, and it's not, it behaves as a dictionnary

includes test case that will fail with the original code
2014-08-29 21:10:48 -07:00
drebs a26cc9c0f4 Fix verify_file() to really treat signed data as file descriptor. 2014-08-27 12:29:14 -03:00
Isis Lovecruft 4d120a2288
Add unittest which tests encrypt() when `output` is given an open file.
* ADD new unittest, `test_encryption_to_filehandle`.
2014-08-02 04:14:22 +00:00
Isis Lovecruft 83784657d5
Add new unittest that tests encryption with a filename output.
* ADD test_encryption_to_filename which checks that encrypt(...,
   output='somefilename.gpg') works correctly (when `output` is a string
   containing the filename).
   This tests for the bug reported in Issue #24.
   https://github.com/isislovecruft/python-gnupg/issues/24
2014-08-02 04:02:15 +00:00
kali 99e3407036 fix failing test_signature_string_bad_passphase
also, do pass a passphrase to test_signature_string_verification
so that we have something to compare to.
2014-08-01 17:13:27 -05:00
Isis Lovecruft ebd93db8c2
Merge remote-tracking branch 'zigg/fix/py3k-tests' into develop 2014-06-04 20:30:44 +00:00
Thomas Tanner 1fd400b5d3 more py2.6 fixes 2014-04-23 14:49:24 +02:00
Thomas Tanner 6b7fe3467d py2.6 support for testing 2014-04-23 14:06:30 +02:00
Matt Behrens e87e67cf15 more tests for #16. all now pass except one 2014-03-31 11:32:35 -04:00
Matt Behrens 3be2697a1b WIP fixing serveral Python 3 tests for #16 2014-03-30 19:53:45 -04:00
Isis Lovecruft 425d116ae0
Rewrite verification unittests to use correct parameters 2013-12-04 10:16:04 +00:00
drebs 678d36ea62 Fix path creation. 2013-10-14 17:09:09 -03:00
Isis Lovecruft 88e5bd7827
Rewrite unittest test_encryption_multi_recipient().
It's still failing. Oddly, test_encryption_decryption_multi_recipient() is not
failing...
2013-10-08 12:26:42 +00:00
Isis Lovecruft 10d7e61ee4
Delete output file created by test_copy_data_bytesio() unittest. 2013-10-08 10:27:04 +00:00
Isis Lovecruft 9f6908ffb0
Remove unused unittest.TestCase.setUpClass() method.
* REMOVE boilerplated unittest.TestCase.setUpClass() method, as it did
   nothing and was not being called anywhere.
2013-10-08 08:50:08 +00:00
Isis Lovecruft 903ffd3906
FIX unittest test_copy_data_bytesio().
* CHANGE unittest test_copy_data_bytesio() to actually check that the output
   data matches the original message string given to io.BytesIO().
 * REMOVE class test.test_gnupg.ResultStringIO, as it is now not used
   anywhere.
 * FIXES test_copy_data_bytesio() not actually testing what it was supposed
   to.
2013-10-08 08:46:19 +00:00
Isis Lovecruft 0166b4bc6a
Fix test failure due to static binary path arg in unittest.
* CHANGE unittest test_make_args_drop_protected_options() to discover the
   path to the GnuPG binary; the discovered path SHOULD be the same as that
   which was discovered upon class instantiation.
 * FIXES failure in unittest test_make_args_drop_protected_options() which was
   caused by the path to the GnuPG binary being hardcoded.
2013-10-08 08:27:22 +00:00
Isis Lovecruft 8cccef433d
Remove __package__ setting and import code in test_gnupg.py.
* FIXES bug which caused py3k tests to fail to run.
2013-07-31 22:23:30 +00:00
Isis Lovecruft 1e5c1c2311
Merge remote-tracking branch 'mmn/fixes_for_test_gpg_binary_version_str' into develop
* ADD patches from Mikael Nordfeldth.
 * FIXES #14 issues with strcmp in unittests looking for string literals when
   Python3 expects byte strings.
 * TODO: perhaps there should be a generalized function in
   gnupg/test/test_gnupg.py which automatically translates Python2 strings to
   b'' strings.
 * CLOSES issue #14.
2013-07-30 12:05:51 +00:00
Mikael Nordfeldth aa6ced5d14 stdout.read() wants bytes, which failed on Py3 str
I don't know how far back the b"byte string" syntax is compatible with this change in Python 2.x, but in 2.7.3 it works as it should.
2013-07-29 00:27:54 +02:00
Mikael Nordfeldth ce76fd130a Grammar fix, repeated word in test description 2013-07-29 00:27:45 +02:00
Mikael Nordfeldth 167d51f15e Simple indentation error fix 2013-07-28 18:17:52 +02:00
Isis Lovecruft 6b154c294e
Change LICENSE to GPLv3+, after discussion with intrigeri.
* ADD docs/change-license-emails.txt, which includes email exchanges between
   myself and intrigeri, including links to Debian and LEAP mailing lists with
   arguments for and against using AGPL for a library.
 * CHANGE license header for all files.
 * CHANGE LICENSE file and gnupg/copyright.py to use GPLv3+ text.
2013-07-27 19:27:53 +00:00
Mikael Nordfeldth f80f216625 mktime takes local time, not UTC
GPG signature timestamps are considered UTC, this may cause times to be off
by delta > 1000 in def test_signature_string_verification because it
incorrectly gave gmtime() as an argument to mktime().

Python 2 and 3 docs both say that mktime should have a struct_time argument
"which expresses the time in local time, not UTC". So the test is now using
time.localtime() instead of time.gmtime()
2013-07-24 17:28:18 +02:00
Isis Lovecruft 78af852d25
Fix putting keys generated during unittests into tests/generated-keys/. 2013-07-09 08:16:27 +00:00
Isis Lovecruft fca8491ceb
Remove two unused inspect module imports from gnupg.py. 2013-07-06 09:01:21 +00:00
Isis Lovecruft d199a7512e
Start Pythonising the Makefile test cleanup actions. 2013-07-02 09:36:48 +00:00
Isis Lovecruft 1a38d786a3
Fix unittest import_with_colons to use key dict. 2013-07-02 09:14:56 +00:00
Isis Lovecruft b3decd7b73
Add imports specific to running unittests after an installation. 2013-07-02 09:13:58 +00:00
Isis Lovecruft ab54c7b71e
Make detached binary sig unittest test what it's supposed to. 2013-07-02 07:17:51 +00:00
Isis Lovecruft 0ca6352457
Add check on recv-key size after writing it to a file. 2013-07-02 07:15:31 +00:00