Ejemplo n.º 1
0
 def it_can_dispatch_an_extract_command_to_the_app(self, args_,
                                                   app_controller_):
     # fixture ----------------------
     extract_command = ExtractCommand(None)
     # exercise ---------------------
     extract_command.execute(args_, app_controller_)
     # verify -----------------------
     app_controller_.extract_package.assert_called_once_with(
         args_.pkg_path, args_.dirpath)
Ejemplo n.º 2
0
 def it_should_trigger_parser_error_if_pkg_path_does_not_exist(
         self, args_, parser_):
     # fixture ----------------------
     args_.pkg_path = 'foobar'
     extract_command = ExtractCommand(parser_)
     # exercise ---------------------
     extract_command.validate(args_)
     # verify -----------------------
     parser_.error.assert_called_once_with(ANY)
     assert 'PKG_PATH' in parser_.error.call_args[0][0]
Ejemplo n.º 3
0
 def it_should_add_a_extract_command_parser(self, extract_argv_, parser,
                                            subparsers):
     # exercise ---------------------
     subparser = ExtractCommand.add_command_parser_to(subparsers)
     args = parser.parse_args(extract_argv_)
     # verify -----------------------
     assert args.pkg_path == ARG_PKG_PATH
     assert args.dirpath == ARG_DIRPATH
     assert isinstance(subparser, argparse.ArgumentParser)