← Back to team overview

launchpad-dev team mailing list archive

Re: [Branch ~launchpad-pqm/launchpad/devel] Rev 10012: [r=mwhudson][ui=none] Allow listing sftp directories on

 

On Wed, Dec 09, 2009 at 10:38:37AM -0500, Aaron Bentley wrote:
> Bjorn Tillenius wrote:
> > On Wed, Dec 09, 2009 at 09:57:51AM -0500, Aaron Bentley wrote:
> >> Bjorn Tillenius wrote:
> 
> > Well, reading the code, it looks like it can be either None or not
> > exist. How do I know that it can't be None?
> 
> By knowing what a stat_result is.

...which I don't know :)


> > Also, why do you have this assert as the last check?
> 
> Because I added it after the previous assert was passing.
> 
> > I'm asking, since
> > somehow it feels natural to me to first check the pre-conditions, and
> > then make sure the code works, rather then first showing that the code
> > works, and then check the pre-conditions. For example, what happens if
> > the pre-condition fails? Where is the error reported?
> 
> It's not a pre-condition, it's a post-condition.
> 
> > Of course, there's
> > also the question, do you need to check that that the attribute is
> > missing?
> 
> Yes.  It would be bad for _format_directory_entries to modify its input.

Oh, right, now I see. Again, this is far from obvious, so you need to
somehow explain that the test actually is to make sure that
_format_directory_entries() doesn't modify the input.


-- 
Björn Tillenius | https://launchpad.net/~bjornt



Follow ups

References