| 272 | self.assertEqual(foo().__name__, "B") |
| 273 | |
| 274 | def test_create_class2(self): |
| 275 | SAMPLE_CODE1 = """ |
| 276 | class C(object): |
| 277 | def foo(self): |
| 278 | return 0 |
| 279 | """ |
| 280 | # Creating a new class and using it from old class |
| 281 | SAMPLE_CODE2 = """ |
| 282 | class B(object): |
| 283 | pass |
| 284 | |
| 285 | class C(object): |
| 286 | def foo(self): |
| 287 | return B |
| 288 | """ |
| 289 | |
| 290 | self.make_mod(sample=SAMPLE_CODE1) |
| 291 | import x # @UnresolvedImport |
| 292 | |
| 293 | foo = x.C().foo |
| 294 | self.assertEqual(foo(), 0) |
| 295 | self.make_mod(sample=SAMPLE_CODE2) |
| 296 | pydevd_reload.xreload(x) |
| 297 | self.assertEqual(foo().__name__, "B") |
| 298 | |
| 299 | def test_parent_function(self): |
| 300 | SAMPLE_CODE1 = """ |