Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Sep 1, 2016
1 parent ff06e84 commit 2c97cc5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions glue/core/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,9 +703,9 @@ def _save_data_3(data, context):
@loader(Data, version=3)
def _load_data_3(rec, context):
result = _load_data_2(rec, context)
yield result
result._key_joins = dict((context.object(k), (context.object(v0), context.object(v1)))
for k, v0, v1 in rec['_key_joins'])
return result


@saver(Data, version=4)
Expand All @@ -722,12 +722,12 @@ def save_cid_tuple(cids):
@loader(Data, version=4)
def _load_data_4(rec, context):
result = _load_data_2(rec, context)
yield result
def load_cid_tuple(cids):
return tuple(context.object(cid) for cid in cids)
result._key_joins = dict((context.object(k), (load_cid_tuple(v0), load_cid_tuple(v1)))
for k, v0, v1 in rec['_key_joins'])
result.uuid = rec['uuid']
return result


@saver(ComponentID)
Expand Down
1 change: 1 addition & 0 deletions glue/core/tests/test_subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ class TestSubsetIo(object):
def setup_method(self, method):
self.data = MagicMock(spec=Data)
self.data.shape = (4, 4)
self.data.uuid = 'abcde'
self.subset = Subset(self.data)
inds = np.array([1, 2, 3])
self.subset.subset_state = ElementSubsetState(indices=inds)
Expand Down

0 comments on commit 2c97cc5

Please sign in to comment.