def test_can_be_pickled(self): obj = [1, 2, 3] delegator = SimpleDelegator(obj) pickled = pickle.dumps(delegator) del delegator unpickled_delegator = pickle.loads(pickled) expect(get_delegated(unpickled_delegator)) == obj
def test_sets_object_inside_delegator(self): delegator = SimpleDelegator(mock.Mock()) another_obj = mock.Mock() set_delegated(delegator, another_obj) expect(get_delegated(delegator)) == another_obj
def test_returns_object_inside_delegator(self): obj = mock.Mock() delegator = SimpleDelegator(obj) expect(get_delegated(delegator)) == obj