<s> from base_test_case import BaseTestCase <EOL> from cursesmenu import CursesMenu <EOL> from cursesmenu . items import MenuItem <EOL> class TestMenuItem ( BaseTestCase ) : <EOL> def setUp ( self ) : <EOL> super ( TestMenuItem , self ) . setUp ( ) <EOL> self . menu = CursesMenu ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> def test_init ( self ) : <EOL> menu_item_1 = MenuItem ( "<STR_LIT>" , self . menu ) <EOL> menu_item_2 = MenuItem ( "<STR_LIT>" , self . menu , True ) <EOL> menu_item_3 = MenuItem ( text = "<STR_LIT>" , menu = self . menu , should_exit = False ) <EOL> self . assertEqual ( menu_item_1 . text , "<STR_LIT>" ) <EOL> self . assertEqual ( menu_item_2 . text , "<STR_LIT>" ) <EOL> self . assertEqual ( menu_item_3 . text , "<STR_LIT>" ) <EOL> self . assertEqual ( menu_item_1 . menu , self . menu ) <EOL> self . assertEqual ( menu_item_2 . menu , self . menu ) <EOL> self . assertEqual ( menu_item_3 . menu , self . menu ) <EOL> self . assertFalse ( menu_item_1 . should_exit ) <EOL> self . assertTrue ( menu_item_2 . should_exit ) <EOL> self . assertFalse ( menu_item_3 . should_exit ) <EOL> def test_show ( self ) : <EOL> menu_item = MenuItem ( "<STR_LIT>" , self . menu ) <EOL> self . assertEqual ( menu_item . show ( <NUM_LIT:0> ) , "<STR_LIT>" ) </s>
