| 1 | from pyglet.shapes import Circle |
| 2 | from pyglet.graphics import Group, Batch |
| 3 | |
| 4 | |
| 5 | def test_batch_migration(): |
| 6 | batch = Batch() |
| 7 | group = Group(order=10) |
| 8 | shape = Circle(100, 100, 50, batch=batch, group=group) |
| 9 | assert shape.batch == batch |
| 10 | assert shape.group == group |
| 11 | |
| 12 | new_batch = Batch() |
| 13 | shape.batch = new_batch |
| 14 | assert shape.batch == new_batch |
| 15 | |
| 16 | |
| 17 | def test_group_migration(): |
| 18 | batch = Batch() |
| 19 | group = Group(order=10) |
| 20 | shape = Circle(100, 100, 50, batch=batch, group=group) |
| 21 | assert shape.batch == batch |
| 22 | assert shape.group == group |
| 23 | |
| 24 | new_group = Group() |
| 25 | shape.group = new_group |
| 26 | assert shape.group == new_group |