<s> from __future__ import absolute_import <EOL> from traits . testing . unittest_tools import unittest <EOL> from . . action import Action <EOL> from . . action_controller import ActionController <EOL> from . . action_event import ActionEvent <EOL> class TestActionController ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . memo = [ ] <EOL> def perform ( ) : <EOL> self . memo . append ( '<STR_LIT>' ) <EOL> self . action = Action ( name = '<STR_LIT>' , on_perform = perform ) <EOL> self . action_controller = ActionController ( ) <EOL> def test_perform ( self ) : <EOL> event = ActionEvent ( ) <EOL> self . action_controller . perform ( self . action , event ) <EOL> self . assertEqual ( self . memo , [ '<STR_LIT>' ] ) <EOL> def test_perform_none ( self ) : <EOL> action = Action ( name = '<STR_LIT>' ) <EOL> event = ActionEvent ( ) <EOL> self . action_controller . perform ( action , event ) <EOL> def test_can_add_to_menu ( self ) : <EOL> result = self . action_controller . can_add_to_menu ( self . action ) <EOL> self . assertTrue ( result ) <EOL> def test_add_to_menu ( self ) : <EOL> self . action_controller . add_to_menu ( self . action ) <EOL> def test_can_add_to_toolbar ( self ) : <EOL> result = self . action_controller . can_add_to_toolbar ( self . action ) <EOL> self . assertTrue ( result ) <EOL> def test_add_to_toolbar ( self ) : <EOL> self . action_controller . add_to_toolbar ( self . action ) </s>
