Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.41
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
local /
lib /
python3.10 /
test /
test_email /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-sr-x
2025-06-04 09:23
data
[ DIR ]
drwxr-sr-x
2025-06-04 09:23
__init__.py
6.19
KB
-rw-r--r--
2025-06-04 09:23
__main__.py
72
B
-rw-r--r--
2025-06-04 09:23
test__encoded_words.py
6.92
KB
-rw-r--r--
2025-06-04 09:23
test__header_value_parser.py
123.32
KB
-rw-r--r--
2025-06-04 09:23
test_asian_codecs.py
3.07
KB
-rw-r--r--
2025-06-04 09:23
test_contentmanager.py
34.28
KB
-rw-r--r--
2025-06-04 09:23
test_defect_handling.py
11.69
KB
-rw-r--r--
2025-06-04 09:23
test_email.py
209.52
KB
-rw-r--r--
2025-06-04 09:23
test_generator.py
11.89
KB
-rw-r--r--
2025-06-04 09:23
test_headerregistry.py
63.71
KB
-rw-r--r--
2025-06-04 09:23
test_inversion.py
2.24
KB
-rw-r--r--
2025-06-04 09:23
test_message.py
34.08
KB
-rw-r--r--
2025-06-04 09:23
test_parser.py
4.23
KB
-rw-r--r--
2025-06-04 09:23
test_pickleable.py
2.49
KB
-rw-r--r--
2025-06-04 09:23
test_policy.py
15.51
KB
-rw-r--r--
2025-06-04 09:23
test_utils.py
7.27
KB
-rw-r--r--
2025-06-04 09:23
torture_test.py
3.52
KB
-rw-r--r--
2025-06-04 09:23
Save
Rename
import unittest import textwrap import copy import pickle import email import email.message from email import policy from email.headerregistry import HeaderRegistry from test.test_email import TestEmailBase, parameterize @parameterize class TestPickleCopyHeader(TestEmailBase): header_factory = HeaderRegistry() unstructured = header_factory('subject', 'this is a test') header_params = { 'subject': ('subject', 'this is a test'), 'from': ('from', 'frodo@mordor.net'), 'to': ('to', 'a: k@b.com, y@z.com;, j@f.com'), 'date': ('date', 'Tue, 29 May 2012 09:24:26 +1000'), } def header_as_deepcopy(self, name, value): header = self.header_factory(name, value) h = copy.deepcopy(header) self.assertEqual(str(h), str(header)) def header_as_pickle(self, name, value): header = self.header_factory(name, value) for proto in range(pickle.HIGHEST_PROTOCOL + 1): p = pickle.dumps(header, proto) h = pickle.loads(p) self.assertEqual(str(h), str(header)) @parameterize class TestPickleCopyMessage(TestEmailBase): # Message objects are a sequence, so we have to make them a one-tuple in # msg_params so they get passed to the parameterized test method as a # single argument instead of as a list of headers. msg_params = {} # Note: there will be no custom header objects in the parsed message. msg_params['parsed'] = (email.message_from_string(textwrap.dedent("""\ Date: Tue, 29 May 2012 09:24:26 +1000 From: frodo@mordor.net To: bilbo@underhill.org Subject: help I think I forgot the ring. """), policy=policy.default),) msg_params['created'] = (email.message.Message(policy=policy.default),) msg_params['created'][0]['Date'] = 'Tue, 29 May 2012 09:24:26 +1000' msg_params['created'][0]['From'] = 'frodo@mordor.net' msg_params['created'][0]['To'] = 'bilbo@underhill.org' msg_params['created'][0]['Subject'] = 'help' msg_params['created'][0].set_payload('I think I forgot the ring.') def msg_as_deepcopy(self, msg): msg2 = copy.deepcopy(msg) self.assertEqual(msg2.as_string(), msg.as_string()) def msg_as_pickle(self, msg): for proto in range(pickle.HIGHEST_PROTOCOL + 1): p = pickle.dumps(msg, proto) msg2 = pickle.loads(p) self.assertEqual(msg2.as_string(), msg.as_string()) if __name__ == '__main__': unittest.main()