<s> from __future__ import absolute_import <EOL> from traits . testing . unittest_tools import unittest , UnittestTools <EOL> from . . gui import GUI <EOL> from . . image_resource import ImageResource <EOL> from . . splash_screen import SplashScreen <EOL> class TestWindow ( unittest . TestCase , UnittestTools ) : <EOL> def setUp ( self ) : <EOL> self . gui = GUI ( ) <EOL> self . window = SplashScreen ( ) <EOL> def test_destroy ( self ) : <EOL> self . window . destroy ( ) <EOL> def test_open_close ( self ) : <EOL> with self . assertTraitChanges ( self . window , '<STR_LIT>' , count = <NUM_LIT:1> ) : <EOL> with self . assertTraitChanges ( self . window , '<STR_LIT>' , count = <NUM_LIT:1> ) : <EOL> self . window . open ( ) <EOL> self . gui . process_events ( ) <EOL> with self . assertTraitChanges ( self . window , '<STR_LIT>' , count = <NUM_LIT:1> ) : <EOL> with self . assertTraitChanges ( self . window , '<STR_LIT>' , count = <NUM_LIT:1> ) : <EOL> self . window . close ( ) <EOL> self . gui . process_events ( ) <EOL> def test_show ( self ) : <EOL> self . window . _create ( ) <EOL> self . window . show ( True ) <EOL> self . gui . process_events ( ) <EOL> self . window . show ( False ) <EOL> self . gui . process_events ( ) <EOL> self . window . destroy ( ) <EOL> def test_image ( self ) : <EOL> self . window . image = ImageResource ( '<STR_LIT>' ) <EOL> with self . assertTraitChanges ( self . window , '<STR_LIT>' , count = <NUM_LIT:1> ) : <EOL> with self . assertTraitChanges ( self . window , '<STR_LIT>' , count = <NUM_LIT:1> ) : <EOL> self . window . open ( ) <EOL> self . gui . process_events ( ) <EOL> with self . assertTraitChanges ( self . window , '<STR_LIT>' , count = <NUM_LIT:1> ) : <EOL> with self . assertTraitChanges ( self . window , '<STR_LIT>' , count = <NUM_LIT:1> ) : <EOL> self . window . close ( ) <EOL> self . gui . process_events ( ) <EOL> def test_text ( self ) : <EOL> self . window . text = "<STR_LIT>" <EOL> with self . assertTraitChanges ( self . window , '<STR_LIT>' , count = <NUM_LIT:1> ) : <EOL> with self . assertTraitChanges ( self . window , '<STR_LIT>' , count = <NUM_LIT:1> ) : <EOL> self . window . open ( ) <EOL> self . gui . process_events ( ) <EOL> with self . assertTraitChanges ( self . window , '<STR_LIT>' , count = <NUM_LIT:1> ) : <EOL> with self . assertTraitChanges ( self . window , '<STR_LIT>' , count = <NUM_LIT:1> ) : <EOL> self . window . close ( ) <EOL> self . gui . process_events ( ) <EOL> def test_text_changed ( self ) : <EOL> with self . assertTraitChanges ( self . window , '<STR_LIT>' , count = <NUM_LIT:1> ) : <EOL> with self . assertTraitChanges ( self . window , '<STR_LIT>' , count = <NUM_LIT:1> ) : <EOL> self . window . open ( ) <EOL> self . gui . process_events ( ) <EOL> self . window . text = "<STR_LIT>" <EOL> self . gui . process_events ( ) <EOL> with self . assertTraitChanges ( self . window , '<STR_LIT>' , count = <NUM_LIT:1> ) : <EOL> with self . assertTraitChanges ( self . window , '<STR_LIT>' , count = <NUM_LIT:1> ) : <EOL> self . window . close ( ) <EOL> self . gui . process_events ( ) </s>
