On Thu, Oct 22, 2015 at 10:53 AM, Daniel Gillet <[email protected]> wrote:
> Hi Claudio, > > ... > By the way, I thought it would have been better to implement a unittest > for this problem. But looking at the tests for scenes > test_director_scene_changes.py, I noticed that it's not dealing with > transitions. Should I add one test there? But that means I'll need to add > a dependency with TransitionScene. Or should I make a new unittest file > for testing transitions? > > Well, the stronger solution enforces 'all scene that goes active will have a parent None', so - it is easier to write the tests in terms of generic scenes - it is stronger to write in terms of genetic scenes Given that, test_director_scene_changes.py seems ok, probably in another class that the one there. I think that what we want to assert is "whatever the method that causes a scene go to top (run, replace, pop), when his on_enter method is called, then scene.parent is None" This ensures: - the scene entering can see it will be the top scene (not a part of transition or a collage) at his on enter method - any child can walk-up the parent chain in his on_enter method without never going out of the active scene -- You received this message because you are subscribed to the Google Groups "cocos2d discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/cocos-discuss. For more options, visit https://groups.google.com/d/optout.
