Commit 672237d8 authored by Jason Madden's avatar Jason Madden

PEP-8ify additions as recommended by the pep8 tool.

parent ad3e7a0b
......@@ -31,14 +31,13 @@ class Folder(btree.BTreeContainer):
def data(self, value):
self._SampleContainer__data = value
def __getstate__( self ):
state = super(Folder,self).__getstate__()
data = state.pop( '_SampleContainer__data' )
def __getstate__(self):
state = super(Folder, self).__getstate__()
data = state.pop('_SampleContainer__data')
state['data'] = data
return state
def __setstate__( self, state ):
def __setstate__(self, state):
if 'data' in state and '_SampleContainer__data' not in state:
state['_SampleContainer__data'] = state.pop( 'data' )
super(Folder,self).__setstate__( state )
state['_SampleContainer__data'] = state.pop('data')
super(Folder, self).__setstate__(state)
......@@ -19,10 +19,10 @@ class Test(TestSampleContainer, TestCase):
def testPickleCompatibility(self):
folder = self.makeTestObject()
folder['a'] = 1
self.assertEqual( folder.__getstate__()['data'], folder._SampleContainer__data )
self.assertEqual(folder.__getstate__()['data'], folder._SampleContainer__data)
folder_clone = pickle.loads( pickle.dumps( folder ) )
self.assertEqual( folder_clone['a'], folder['a'] )
folder_clone = pickle.loads(pickle.dumps(folder))
self.assertEqual(folder_clone['a'], folder['a'])
def test_suite():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment