Re: [Tutor] Using unittest module for Test Driven Development

2014-08-25 Thread Alex Kleider
On 2014-08-25 01:10, Marc Tompkins wrote: On Mon, Aug 25, 2014 at 12:04 AM, Alex Kleider wrote: I appreciate your further elucidation, like your 'sledge hammer' metaphor and thank you for the fragility warning. I expect within such a limited scope, the dangers are not great. As someone who

Re: [Tutor] Using unittest module for Test Driven Development

2014-08-25 Thread Marc Tompkins
On Mon, Aug 25, 2014 at 12:04 AM, Alex Kleider wrote: > I appreciate your further elucidation, like your 'sledge hammer' metaphor and > thank you for the fragility warning. I expect within such a limited scope, > the dangers are not great. As someone who has been burned by this sort of thinkin

Re: [Tutor] Using unittest module for Test Driven Development

2014-08-25 Thread Alex Kleider
On 2014-08-24 21:30, Danny Yoo wrote: Is there a way that I can provide the file name command line parameters to compare.py so that its get_args function can be tested? sys.argv is writeable, or better still, provide get_args() an optional argument to use instead of sys.argv.o I don't und

Re: [Tutor] Using unittest module for Test Driven Development

2014-08-24 Thread Danny Yoo
>>> Is there a way that I can provide the file name command line parameters >>> to compare.py so that its get_args function can be tested? >> >> sys.argv is writeable, or better still, provide get_args() an optional >> argument to use instead of sys.argv.o > > > I don't understand what you mean by

Re: [Tutor] Using unittest module for Test Driven Development

2014-08-24 Thread Alex Kleider
Thank you very much, Steven. This is just the help I needed. Forgive me for causing confusion- I pared down my code for presentation but not enough and also left the names which now out of context, don't make sense. In line explanations provided below although it would probably be of little i

Re: [Tutor] Using unittest module for Test Driven Development

2014-08-24 Thread Steven D'Aprano
On Sun, Aug 24, 2014 at 05:23:35PM -0700, Alex Kleider wrote: > Given > $ cat compare.py > #!/usr/bin/env python3 > import os > import sys > > def get_args(): > try: > args = sys.argv[1:] > except IndexError: > return > return [arg for arg in args if os.path.isfile(arg)