Beispiel #1
0
 def it_can_dispatch_browse_command_to_app(self, args_, app_controller_):
     # fixture ----------------------
     browse_command = BrowseCommand(None)
     # exercise ---------------------
     browse_command.execute(args_, app_controller_)
     # verify -----------------------
     app_controller_.browse.assert_called_once_with(args_.pkg_path,
                                                    args_.filename)
Beispiel #2
0
 def it_should_trigger_parser_error_if_pkg_path_does_not_exist(
         self, args_, parser_):
     # fixture ----------------------
     args_.pkg_path = 'foobar'
     browse_command = BrowseCommand(parser_)
     # exercise ---------------------
     browse_command.validate(args_)
     # verify -----------------------
     parser_.error.assert_called_once_with(ANY)
Beispiel #3
0
 def it_should_add_a_browse_command_parser(self, browse_argv_, parser,
                                           subparsers):
     # exercise ---------------------
     subparser = BrowseCommand.add_command_parser_to(subparsers)
     args = parser.parse_args(browse_argv_)
     # verify -----------------------
     assert args.pkg_path == ARG_PKG_PATH
     assert args.filename == ARG_FILENAME
     assert isinstance(subparser, argparse.ArgumentParser)