-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
parser/CliBoundArguments: [breaking] use attrs and put parsing in method
The preferred method for invoking the parser remains CliSignature#parse_arguments. If you were using: CliBoundArguments(csig, in_args, name) Please add a call to CliBoundArguments#process_arguments: ba = CliBoundArguments(csig, in_args, name) ba.process_arguments() The advantage now is that you can more easily set up instances of CliBoundArguments for testing: myparam = ... csig = CliSignature([myparam]) ba = CliBoundArguments(csig, ['arg'], 'test', kwargs={'myparam':'1'} myparam.read_argument(ba, 0) self.assertEqual(ba.kwargs['myparam'], 2)
- Loading branch information
Showing
2 changed files
with
35 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters