<s> import os <EOL> from bento . compat . api . moves import unittest <EOL> from bento . core import PackageDescription <EOL> from bento . core . node import create_first_node <EOL> from bento . commands . core import HelpCommand , Command <EOL> from bento . commands . command_contexts import HelpContext <EOL> from bento . commands . wrapper_utils import run_command_in_context <EOL> from bento . commands . contexts import GlobalContext <EOL> from bento . commands . options import OptionsContext <EOL> import bento . commands . registries <EOL> class TestHelpCommand ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . run_node = create_first_node ( os . getcwd ( ) ) <EOL> registry = bento . commands . registries . CommandRegistry ( ) <EOL> registry . register ( "<STR_LIT>" , Command ) <EOL> registry . register ( "<STR_LIT>" , Command ) <EOL> registry . register ( "<STR_LIT>" , Command ) <EOL> registry . register ( "<STR_LIT>" , Command ) <EOL> registry . register ( "<STR_LIT>" , Command ) <EOL> registry . register ( "<STR_LIT>" , Command ) <EOL> self . registry = registry <EOL> self . options_registry = bento . commands . registries . OptionsRegistry ( ) <EOL> self . options_registry . register ( "<STR_LIT>" , OptionsContext ( ) ) <EOL> def test_simple ( self ) : <EOL> help = HelpCommand ( ) <EOL> options = OptionsContext ( ) <EOL> for option in HelpCommand . common_options : <EOL> options . add_option ( option ) <EOL> global_context = GlobalContext ( None , <EOL> commands_registry = self . registry , <EOL> options_registry = self . options_registry ) <EOL> pkg = PackageDescription ( ) <EOL> context = HelpContext ( global_context , [ ] , options , pkg , self . run_node ) <EOL> run_command_in_context ( context , help ) <EOL> def test_command ( self ) : <EOL> help = HelpCommand ( ) <EOL> options = OptionsContext ( ) <EOL> for option in HelpCommand . common_options : <EOL> options . add_option ( option ) <EOL> pkg = PackageDescription ( ) <EOL> global_context = GlobalContext ( None , <EOL> commands_registry = self . registry , <EOL> options_registry = self . options_registry ) <EOL> context = HelpContext ( global_context , [ "<STR_LIT>" ] , options , pkg , self . run_node ) <EOL> run_command_in_context ( context , help ) </s>
