<s> from . setup import TestPygletGUI <EOL> from pyglet_gui . core import Viewer <EOL> from pyglet_gui . manager import Manager <EOL> from pyglet_gui . containers import VerticalContainer <EOL> class TestVerticalContainer ( TestPygletGUI ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> super ( TestVerticalContainer , self ) . setUp ( ) <EOL> self . container = VerticalContainer ( [ Viewer ( width = <NUM_LIT:50> , height = <NUM_LIT:50> ) , <EOL> Viewer ( width = <NUM_LIT:50> , height = <NUM_LIT:50> ) ] ) <EOL> self . manager = Manager ( self . container , window = self . window , batch = self . batch , theme = self . theme ) <EOL> def _test_content_position ( self ) : <EOL> """<STR_LIT>""" <EOL> self . assertEqual ( self . container . content [ <NUM_LIT:0> ] . y , <EOL> self . container . y + self . container . height - self . container . content [ <NUM_LIT:0> ] . height ) <EOL> self . assertEqual ( self . container . content [ <NUM_LIT:1> ] . y , <EOL> self . container . y + self . container . height <EOL> - self . container . content [ <NUM_LIT:0> ] . height - self . container . content [ <NUM_LIT:1> ] . height <EOL> - self . container . padding ) <EOL> def test_top_down_draw ( self ) : <EOL> """<STR_LIT>""" <EOL> self . assertEqual ( self . container . width , <NUM_LIT:50> ) <EOL> self . assertEqual ( self . container . height , <NUM_LIT:100> + self . container . padding ) <EOL> self . assertEqual ( self . container . x , self . window . width // <NUM_LIT:2> - self . container . width // <NUM_LIT:2> ) <EOL> self . assertEqual ( self . container . y , self . window . height // <NUM_LIT:2> - self . container . height // <NUM_LIT:2> ) <EOL> self . _test_content_position ( ) <EOL> def test_bottom_up_draw ( self ) : <EOL> """<STR_LIT>""" <EOL> self . container . content [ <NUM_LIT:0> ] . width = <NUM_LIT> <EOL> self . container . content [ <NUM_LIT:0> ] . height = <NUM_LIT> <EOL> self . container . content [ <NUM_LIT:0> ] . parent . reset_size ( ) <EOL> self . assertEqual ( self . container . width , <NUM_LIT> ) <EOL> self . assertEqual ( self . container . height , <NUM_LIT> + self . container . padding ) <EOL> self . assertEqual ( self . container . x , self . window . width // <NUM_LIT:2> - self . container . width // <NUM_LIT:2> ) <EOL> self . assertEqual ( self . container . y , self . window . height // <NUM_LIT:2> - self . container . height // <NUM_LIT:2> ) <EOL> self . _test_content_position ( ) <EOL> def test_add_widget ( self ) : <EOL> self . container . add ( Viewer ( width = <NUM_LIT:50> , height = <NUM_LIT:50> ) ) <EOL> self . assertEqual ( self . manager . width , <NUM_LIT:50> ) <EOL> self . assertEqual ( self . manager . height , <NUM_LIT> + <NUM_LIT:2> * self . container . padding ) <EOL> self . _test_content_position ( ) <EOL> def test_remove_widget ( self ) : <EOL> self . container . remove ( self . container . content [ <NUM_LIT:0> ] ) <EOL> self . assertEqual ( self . manager . width , <NUM_LIT:50> ) <EOL> self . assertEqual ( self . manager . height , <NUM_LIT:50> + self . container . padding ) <EOL> def tearDown ( self ) : <EOL> self . manager . delete ( ) <EOL> super ( TestVerticalContainer , self ) . tearDown ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> import unittest <EOL> unittest . main ( ) </s>
