Merge lp:~cjwatson/storm/pickle-variable-tests-dict-order into lp:storm

Proposed by Colin Watson
Status: Merged
Merged at revision: 492
Proposed branch: lp:~cjwatson/storm/pickle-variable-tests-dict-order
Merge into: lp:storm
Diff against target: 28 lines (+3/-2)
1 file modified
tests/store/base.py (+3/-2)
To merge this branch: bzr merge lp:~cjwatson/storm/pickle-variable-tests-dict-order
Reviewer Review Type Date Requested Status
Guillermo Gonzalez Approve
Storm Developers Pending
Review via email: mp+368080@code.launchpad.net

Commit message

Don't depend on dict ordering in pickle variable tests.

Description of the change

We care that pickled output is written back to the underlying variable, but not what order the dict is in.

To post a comment you must log in.
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/store/base.py'
2--- tests/store/base.py 2019-05-29 15:35:00 +0000
3+++ tests/store/base.py 2019-05-29 16:08:48 +0000
4@@ -20,6 +20,7 @@
5 # along with this program. If not, see <http://www.gnu.org/licenses/>.
6 #
7
8+import cPickle as pickle
9 from cStringIO import StringIO
10 import decimal
11 import gc
12@@ -4709,7 +4710,7 @@
13
14 self.store.flush()
15 self.store.reload(blob)
16- self.assertEquals(blob.bin, "\x80\x02}q\x01(U\x01aK\x01U\x01bK\x02u.")
17+ self.assertEquals(pickle.loads(blob.bin), {"a": 1, "b": 2})
18
19 def test_pickle_variable_remove(self):
20 """
21@@ -4931,7 +4932,7 @@
22
23 self.store.flush()
24 self.store.reload(blob)
25- self.assertEquals(blob.bin, "\x80\x02}q\x01(U\x01aK\x01U\x01bK\x02u.")
26+ self.assertEquals(pickle.loads(blob.bin), {"a": 1, "b": 2})
27
28 def test_unhashable_object(self):
29

Subscribers

People subscribed via source and target branches

to status/vote changes: