<s> from __future__ import absolute_import , division , print_function <EOL> import argparse <EOL> import mock <EOL> import sys <EOL> try : <EOL> import unittest2 as unittest <EOL> except ImportError : <EOL> import unittest <EOL> from begin import formatters <EOL> class TestCompose ( unittest . TestCase ) : <EOL> def make_parser ( self , formatter_class ) : <EOL> parser = argparse . ArgumentParser ( description = '<STR_LIT>' , <EOL> formatter_class = formatter_class ) <EOL> parser . add_argument ( '<STR_LIT:test>' , help = '<STR_LIT>' ) <EOL> subparsers = parser . add_subparsers ( title = '<STR_LIT>' ) <EOL> subparser = subparsers . add_parser ( '<STR_LIT>' , help = '<STR_LIT>' , <EOL> formatter_class = formatter_class ) <EOL> subparser . add_argument ( '<STR_LIT:test>' , help = '<STR_LIT>' ) <EOL> return parser <EOL> def test_zero_mixins ( self ) : <EOL> formatter_class = formatters . compose ( ) <EOL> def test_all_mixins ( self ) : <EOL> formatter_class = formatters . compose ( <EOL> formatters . RawArguments , <EOL> formatters . RawDescription , <EOL> formatters . ArgumentDefaults , <EOL> formatters . RemoveSubcommandsLine ) <EOL> def test_with_name ( self ) : <EOL> name = '<STR_LIT>' <EOL> formatter_class = formatters . compose ( formatters . RawDescription , <EOL> name = name ) <EOL> self . assertEqual ( formatter_class . __name__ , name ) <EOL> def test_invalid_keyword ( self ) : <EOL> with self . assertRaises ( TypeError ) : <EOL> formatters . compose ( invalid = None ) <EOL> def test_raw_argument ( self ) : <EOL> formatter_class = formatters . compose ( formatters . RawArguments ) <EOL> parser = self . make_parser ( formatter_class ) <EOL> clihelp = parser . format_help ( ) <EOL> def test_raw_description ( self ) : <EOL> formatter_class = formatters . compose ( formatters . RawDescription ) <EOL> parser = self . make_parser ( formatter_class ) <EOL> clihelp = parser . format_help ( ) <EOL> def test_argument_defaults ( self ) : <EOL> formatter_class = formatters . compose ( formatters . ArgumentDefaults ) <EOL> parser = self . make_parser ( formatter_class ) <EOL> clihelp = parser . format_help ( ) <EOL> def test_remove_subcommands_line ( self ) : <EOL> formatter_class = formatters . compose ( formatters . RemoveSubcommandsLine ) <EOL> parser = self . make_parser ( formatter_class ) <EOL> clihelp = parser . format_help ( ) </s>
