Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Side by Side Diff: third_party/gsutil/boto/tests/mturk/hit_persistence.py

Issue 12317103: Added gsutil to depot tools (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: added readme Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 import unittest
2 import pickle
3
4 from common import MTurkCommon
5
6 class TestHITPersistence(MTurkCommon):
7 def create_hit_result(self):
8 return self.conn.create_hit(
9 question=self.get_question(), **self.get_hit_params()
10 )
11
12 def test_pickle_hit_result(self):
13 result = self.create_hit_result()
14 new_result = pickle.loads(pickle.dumps(result))
15
16 def test_pickle_deserialized_version(self):
17 """
18 It seems the technique used to store and reload the object must
19 result in an equivalent object, or subsequent pickles may fail.
20 This tests a double-pickle to elicit that error.
21 """
22 result = self.create_hit_result()
23 new_result = pickle.loads(pickle.dumps(result))
24 pickle.dumps(new_result)
25
26 if __name__ == '__main__':
27 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698