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

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

Issue 10199002: Upgrade gsutil to 3.4 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments Created 8 years, 7 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 | Annotate | Revision Log
OLDNEW
1 import unittest 1 import unittest
2 import pickle 2 import pickle
3 3
4 from common import MTurkCommon 4 from common import MTurkCommon
5 5
6 class TestHITPersistence(MTurkCommon): 6 class TestHITPersistence(MTurkCommon):
7 def create_hit_result(self): 7 def create_hit_result(self):
8 return self.conn.create_hit( 8 return self.conn.create_hit(
9 question=self.get_question(), **self.get_hit_params() 9 question=self.get_question(), **self.get_hit_params()
10 ) 10 )
11 11
12 def test_pickle_hit_result(self): 12 def test_pickle_hit_result(self):
13 result = self.create_hit_result() 13 result = self.create_hit_result()
14 new_result = pickle.loads(pickle.dumps(result)) 14 new_result = pickle.loads(pickle.dumps(result))
15 15
16 def test_pickle_deserialized_version(self): 16 def test_pickle_deserialized_version(self):
17 """ 17 """
18 It seems the technique used to store and reload the object must 18 It seems the technique used to store and reload the object must
19 result in an equivalent object, or subsequent pickles may fail. 19 result in an equivalent object, or subsequent pickles may fail.
20 This tests a double-pickle to elicit that error. 20 This tests a double-pickle to elicit that error.
21 """ 21 """
22 result = self.create_hit_result() 22 result = self.create_hit_result()
23 new_result = pickle.loads(pickle.dumps(result)) 23 new_result = pickle.loads(pickle.dumps(result))
24 pickle.dumps(new_result) 24 pickle.dumps(new_result)
25 25
26 if __name__ == '__main__': 26 if __name__ == '__main__':
27 unittest.main() 27 unittest.main()
OLDNEW
« no previous file with comments | « third_party/gsutil/boto/tests/mturk/create_hit_with_qualifications.py ('k') | third_party/gsutil/boto/tests/mturk/mocks.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698