8 def __init__(self
, foo
, bar
):
14 return "%s(foo=%r, bar=%r)" % (self
.__class
__.__name
__,
17 return "%s(foo=..., bar=...)" % self
.__class
__.__name
__
19 class AnInstanceWithState(AnInstance
):
21 def __getstate__(self
):
22 return {'attributes': [self
.foo
, self
.bar
]}
24 def __setstate__(self
, state
):
25 self
.foo
, self
.bar
= state
['attributes']
27 class TestRecursive(test_appliance
.TestAppliance
):
29 def _testRecursive(self
, test_name
, recursive_filename
):
30 exec file(recursive_filename
, 'r').read()
36 output1
= dump(value1
)
37 #print "OUTPUT %s:" % test_name
39 value2
= load(output1
)
40 output2
= dump(value2
)
41 self
.failUnlessEqual(output1
, output2
)
43 print "VALUE1:", value1
44 print "VALUE2:", value2
51 TestRecursive
.add_tests('testRecursive', '.recursive')