diff -urN Twisted-10.0.0.orig/twisted/test/test_jelly.py Twisted-10.0.0/twisted/test/test_jelly.py
|
old
|
new
|
|
| 84 | 84 | Dummy new-style class. |
| 85 | 85 | """ |
| 86 | 86 | |
| | 87 | class E(object): |
| | 88 | """ |
| | 89 | Dummy new-style class with slots. |
| | 90 | """ |
| | 91 | |
| | 92 | __slots__ = ("x", "y") |
| | 93 | |
| | 94 | def __init__(self, x=None, y=None): |
| | 95 | self.x = x |
| | 96 | self.y = y |
| | 97 | |
| | 98 | def __getstate__(self): |
| | 99 | return {"x" : self.x, "y" : self.y} |
| 87 | 100 | |
| | 101 | def __setstate__(self, state): |
| | 102 | self.x = state["x"] |
| | 103 | self.y = state["y"] |
| 88 | 104 | |
| 89 | 105 | class SimpleJellyTest: |
| 90 | 106 | def __init__(self, x, y): |
| … |
… |
|
| 162 | 178 | self.assertIsInstance(m, D) |
| 163 | 179 | self.assertIdentical(m.n2, m.n3) |
| 164 | 180 | |
| | 181 | def test_newStyleWithSlots(self): |
| | 182 | n = E() |
| | 183 | n.x = 1 |
| | 184 | c = jelly.jelly(n) |
| | 185 | m = jelly.unjelly(c) |
| | 186 | self.assertIsInstance(m, E) |
| | 187 | self.assertEquals(n.x, 1) |
| 165 | 188 | |
| 166 | 189 | def test_typeOldStyle(self): |
| 167 | 190 | """ |