-
-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
160 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2068,27 +2068,42 @@ def test_plugin_email_pgp(mock_smtp, mock_smtpssl, tmpdir): | |
# Initialize our email (no from name) | ||
obj = Apprise.instantiate('mailto://user:[email protected]?pgp=yes') | ||
|
||
# Test our names | ||
fnames = obj.pgp_fnames | ||
assert isinstance(fnames, list) | ||
# Nothing to lookup | ||
assert obj.pgp_pubkey is None | ||
assert obj.pgp_public_key() is None | ||
assert obj.pgp_encrypt_message("message") is False | ||
# Keys can not be generated in memory mode | ||
assert obj.pgp_generate_keys() is False | ||
|
||
# login is pgp | ||
obj = Apprise.instantiate('mailto://pgp:[email protected]?pgp=yes') | ||
# The reason... no location to store data | ||
assert obj.store.mode == PersistentStoreMode.MEMORY | ||
|
||
# Test our names | ||
fnames = obj.pgp_fnames | ||
assert isinstance(fnames, list) | ||
tmpdir0 = tmpdir.mkdir('tmp00') | ||
asset = AppriseAsset( | ||
storage_mode=PersistentStoreMode.FLUSH, | ||
storage_path=str(tmpdir0), | ||
) | ||
|
||
# login is pgp | ||
obj = Apprise.instantiate('mailto://chris:[email protected]?pgp=yes') | ||
fnames = obj.pgp_fnames | ||
assert isinstance(fnames, list) | ||
# Prepare PGP | ||
obj = Apprise.instantiate( | ||
'mailto://pgp:[email protected]?pgp=yes', asset=asset) | ||
assert obj.store.mode == PersistentStoreMode.FLUSH | ||
|
||
# Still no public key | ||
assert obj.pgp_pubkey is None | ||
|
||
assert obj.pgp_generate_keys() is True | ||
# Now we'll have a public key | ||
assert isinstance(obj.pgp_pubkey, str) | ||
|
||
# Prepare PGP | ||
obj = Apprise.instantiate( | ||
f'mailto://pgp:[email protected]?pgp=yes&pgpkey={obj.pgp_pubkey}', | ||
asset=asset) | ||
|
||
# We will find our key | ||
assert obj.pgp_public_key() is not None | ||
|
||
# Attempt to generate keys | ||
obj = Apprise.instantiate('mailto://chris:[email protected]?pgp=yes') | ||
# We're in memory mode | ||
assert obj.store.mode == PersistentStoreMode.MEMORY | ||
assert obj.pgp_generate_keys() is False | ||
tmpdir1 = tmpdir.mkdir('tmp01') | ||
# However explicitly setting a path works | ||
assert obj.pgp_generate_keys(str(tmpdir1)) is True | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
-----BEGIN PGP PUBLIC KEY BLOCK----- | ||
|
||
xsBNBGbo3ycBCACjECe63GpZanFYLE678OIhzpvY0J6pCBCZblGxXOuwuv7VPIq7 | ||
XQN91UdOL8huDb/JYRxarDoS6+JvyempbzZt0S+veXDl4pRFb+Q4a5sp1l/Mduw0 | ||
rDFErwfF8SpMPBI2WJUhN9n72UEqXVDvTPdcAka8v8p7dS6/RKZzch8P+EjgJME0 | ||
p9+N/2Lrbi2nDDXD+xD4Odw83J5V8Xn/jie3GCxtXda5XIX3EzTSB30elLLNBMcq | ||
ooooooooooooooooooooooooooooo6bRS9TT34rZZk7qyB2iroq9SdIBCGyn1q4r | ||
uIskVNCsqgP9cMa+S1XePUT77VNNN1yzhACpABEBAAHNIUNocmlzIENhcm9uIDxs | ||
ZWFkMmdvbGRAZ21haWwuooooooooooooooooooooooooooooogILCQIVCAIWAgIe | ||
ARYhBEHHWtq4Kh8dGraFnkmZAD9B29oPAAoJEEmZAD9B29oPAawIAImCijTdvDl8 | ||
Sibwo7gL4ooooooooooooooooooooooooooooofjiEEW8gVQ4W2KDs74aCGkQtQJ | ||
irvNA7WnuyMyXZyvhYa63U7GTk5RdVkMygT0a5n8/8HVAenZrBL6VNaZYw/LlgWd | ||
0knhsmqdGTsjKuYdZ3Cooooooooooooooooooooooooooooo2GWBnvOQje+lQGIf | ||
rE6TIwsf4QoKXSkTakzggbpZZl2hg2O6dJiij1cH+DYFVTaVXw4rVmo8ckTJ9DiF | ||
T9H/EmsNqlSKTTv1Aw4raCFZ+T/Ocsw/vIOoEtVhiT/mfDcIbi0VB3EhYvI3eFso | ||
yiZsjyu9xY0= | ||
=ZY2q | ||
-----END PGP PUBLIC KEY BLOCK----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
-----BEGIN PGP PRIVATE KEY BLOCK----- | ||
|
||
xcLYBGbo3ycBCACjECe63GpZanFYLE678OIhzpvY0J6pCBCZblGxXOuwuv7VPIq7 | ||
XQN91UdOL8huDb/JYRxarDoS6+JvyempbzZt0S+veXDl4pRFb+Q4a5sp1l/Mduw0 | ||
rDFErwfF8SpMPBI2WJUhN9n72UEqXVDvTPdcAka8v8p7dS6/RKZzch8P+EjgJME0 | ||
p9+N/2Lrbi2nDDXD+xD4Odw83J5V8Xn/jie3GCxtXda5XIX3EzTSB30elLLNBMcq | ||
N5xJBTrjhciDzU85Gb+bUecnoj9Oj6bRS9TT34rZZk7qyB2iroq9SdIBCGyn1q4r | ||
uIskVNCsqgP9cMa+S1XePUT77VNNN1yzhACpABEBAAEAB/4tOpPqjqyo9I9Px6pn | ||
Et+GRQqRTvxTIjuIc0MRkRaGxLdeahaI9bm8M2Y9158ed43Uy6zTsaXCDc+W9khr | ||
iL9uInG5mFOqT/iUcf65b49wQVf9HJdT3Ncll+7uBoCW+KqMjHGA7z71TkN2/r8u | ||
QQjzamY4gHInYE+BGgeZSfQ3t1M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qwc6l2GWBnvOQje+lQGIfrE6TIwsf4QoKXSkTakzggbpZZl2h | ||
g2O6dJiij1cH+DYFVTaVXw4rVmo8ckTJ9DiFT9H/EmsNqlSKTTv1Aw4raCFZ+T/O | ||
csw/vIOoEtVhiT/mfDcIbi0VB3EhYvI3eFsoyiZsjyu9xY0= | ||
=dBp6 | ||
-----END PGP PRIVATE KEY BLOCK----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
-----BEGIN PGP PUBLIC KEY BLOCK----- | ||
|
||
xsBNBGbo3ycBCACjECe63GpZanFYLE678OIhzpvY0J6pCBCZblGxXOuwuv7VPIq7 | ||
XQN91UdOL8huDb/JYRxarDoS6+JvyempbzZt0S+veXDl4pRFb+Q4a5sp1l/Mduw0 | ||
rDFErwfF8SpMPBI2WJUhN9n72UEqXVDvTPdcAka8v8p7dS6/RKZzch8P+EjgJME0 | ||
p9+N/2Lrbi2nDDXD+xD4Odw83J5V8Xn/jie3GCxtXda5XIX3EzTSB30elLLNBMcq | ||
N5xJBTrjhciDzU85Gb+bUecnoj9Oj6bRS9TT34rZZk7qyB2iroq9SdIBCGyn1q4r | ||
uIskVNCsqgP9cMa+S1XePUT77VNNN1yzhACpABEBAAHNIUNocmlzIENhcm9uIDxs | ||
ZWFkMmdvbGRAZ21haWwuY29tPsLAggQTAQgALAUCZujfJwIbBgILCQIVCAIWAgIe | ||
ARYhBEHHWtq4Kh8dGraFnkmZAD9B29oPAAoJEEmZAD9B29oPAawIAImCijTdvDl8 | ||
Sibwo7gL4ayF4S3KhaKCYORcMM1oe4pesy5ME6fjiEEW8gVQ4W2KDs74aCGkQtQJ | ||
irvNA7WnuyMyXZyvhYa63U7GTk5RdVkMygT0a5n8/8HVAenZrBL6VNaZYw/LlgWd | ||
0knhsmqdGTsjKuYdZ3CHED85pv/MOwe0pyGOQKtJ1t9qwc6l2GWBnvOQje+lQGIf | ||
rE6TIwsf4QoKXSkTakzggbpZZl2hg2O6dJiij1cH+DYFVTaVXw4rVmo8ckTJ9DiF | ||
T9H/EmsNqlSKTTv1Aw4raCFZ+T/Ocsw/vIOoEtVhiT/mfDcIbi0VB3EhYvI3eFso | ||
yiZsjyu9xY0= | ||
=ZY2q | ||
-----END PGP PUBLIC KEY BLOCK----- |