# HG changeset patch # User Paul Boddie # Date 1350750080 -7200 # Node ID 526ac3c870ab20a14cc79db73e3df5d39cafe0c0 # Parent cbed7abb04da15c4bec1ccb5a413a667a266ced3 Renamed the message wrapping tests, giving them more accurate names. diff -r cbed7abb04da -r 526ac3c870ab tests/test_encrypt.py --- a/tests/test_encrypt.py Fri Oct 19 00:33:37 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -#!/usr/bin/env python - -from email.mime.multipart import MIMEMultipart -from email.mime.application import MIMEApplication -from email.mime.base import MIMEBase -from email.encoders import encode_noop -import sys - -if __name__ == "__main__": - text = sys.stdin.read() - protocol = "application/pgp-encrypted" - subtype = "encrypted" - - # Make the container for the message. - - message = MIMEMultipart(subtype, protocol=protocol) - - # For encrypted content, add the declaration and content. - - declaration = MIMEBase("application", "pgp-encrypted") - declaration.set_payload("Version: 1") - message.attach(declaration) - - content = MIMEApplication(text, "octet-stream", encode_noop) - message.attach(content) - - # Show the resulting message text. - - text = message.as_string() - - print text - -# vim: tabstop=4 expandtab shiftwidth=4 diff -r cbed7abb04da -r 526ac3c870ab tests/test_encrypt_wrap.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test_encrypt_wrap.py Sat Oct 20 18:21:20 2012 +0200 @@ -0,0 +1,33 @@ +#!/usr/bin/env python + +from email.mime.multipart import MIMEMultipart +from email.mime.application import MIMEApplication +from email.mime.base import MIMEBase +from email.encoders import encode_noop +import sys + +if __name__ == "__main__": + text = sys.stdin.read() + protocol = "application/pgp-encrypted" + subtype = "encrypted" + + # Make the container for the message. + + message = MIMEMultipart(subtype, protocol=protocol) + + # For encrypted content, add the declaration and content. + + declaration = MIMEBase("application", "pgp-encrypted") + declaration.set_payload("Version: 1") + message.attach(declaration) + + content = MIMEApplication(text, "octet-stream", encode_noop) + message.attach(content) + + # Show the resulting message text. + + text = message.as_string() + + print text + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r cbed7abb04da -r 526ac3c870ab tests/test_sign.py --- a/tests/test_sign.py Fri Oct 19 00:33:37 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -#!/usr/bin/env python - -from email.mime.multipart import MIMEMultipart -from email.mime.application import MIMEApplication -from email.mime.base import MIMEBase -from email import message_from_string -import sys - -if __name__ == "__main__": - message = sys.argv[1] - text = open(message).read() - signature = sys.stdin.read() - protocol = "application/pgp-signature" - subtype = "signed" - - # Make the container for the message. - - message = MIMEMultipart(subtype, protocol=protocol) - - submessage = message_from_string(text) - message.attach(submessage) - - signature_part = MIMEBase("application", "pgp-signature") - signature_part.set_payload(signature) - message.attach(signature_part) - - # Show the resulting message text. - - text = message.as_string() - - print text - -# vim: tabstop=4 expandtab shiftwidth=4 diff -r cbed7abb04da -r 526ac3c870ab tests/test_sign_wrap.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test_sign_wrap.py Sat Oct 20 18:21:20 2012 +0200 @@ -0,0 +1,33 @@ +#!/usr/bin/env python + +from email.mime.multipart import MIMEMultipart +from email.mime.application import MIMEApplication +from email.mime.base import MIMEBase +from email import message_from_string +import sys + +if __name__ == "__main__": + message = sys.argv[1] + text = open(message).read() + signature = sys.stdin.read() + protocol = "application/pgp-signature" + subtype = "signed" + + # Make the container for the message. + + message = MIMEMultipart(subtype, protocol=protocol) + + submessage = message_from_string(text) + message.attach(submessage) + + signature_part = MIMEBase("application", "pgp-signature") + signature_part.set_payload(signature) + message.attach(signature_part) + + # Show the resulting message text. + + text = message.as_string() + + print text + +# vim: tabstop=4 expandtab shiftwidth=4