Closed ketiltrout closed 2 years ago
I leave to your judgement, but do we need the
===Summary===
if the return exit code is 0?
Maybe. I didn't think about the tests too deeply, but it might be that we're checking the result of the verify operation (i.e. how many files are good/corrupt/missing?) Checking these texts shouldn't be problematic to test, since they're output that our code produces (rather than Click
).
I think all of these failures are due to the test suite relying on particular behaviour exhibited by
Click
that is not part ofClick
's public API and that has changed between versions.Tests which depends on the text flow of usage output (
--help
) are inherently fragile because they assumeClick
's text reflowing isn't going to change.Similarly tests which look for
Click
-produced error messages ("Invalid value for [...]") also aren't a good idea.The rest of these tests were dependent on the
click.progressbar
call inclient.node.verify
not printing the supplied"Scanning files"
label, which it might not do if the elapsed time is small enough, but is also something that can't be relied on. (This is worked around by replacingre.match
calls withre.search
to not tie the search pattern to the start of the string.)Also fix a typo in alpenhorn/client/transport.py