[TIP] network testing complexity

Alfredo Deza alfredodeza at gmail.com
Tue Apr 6 05:43:47 PDT 2010


On Tue, Apr 6, 2010 at 8:32 AM, Michael Foord <fuzzyman at voidspace.org.uk>wrote:

>  On 06/04/2010 13:22, Alfredo Deza wrote:
>
> Hi,
>
>  I am trying to test as much as I can in a small project of mine. However,
> the project has some network usage: pushes files from one spot to another
> with Mercurial via SSH.
>
>  For now, I am creating a testing environment where I have some SSH keys
> enabled and I am able to test this specific functionality.
>
>  However, I also have specific tests for all the methods/functions
> involved. I had a user complain about the network tests breaking (which is
> expected if he doesn't have a proper setup) but I find it very
> useful to have not only tests for methods/functions but also for the final
> output: did the file actually made it?
>
>  Is this approach OK?
>
>  I have had situations where a test for a specific method didn't picked up
> an error but the 'test_final_ouput.py' did (which made me correct the
> tests).
>
>  Maybe I should not include them when distributing my project? Or would
> documentation explaining how to set everything up so tests can run correctly
> would be enough?
>
>
> Having functional tests (end-to-end, integration tests, whatever you want
> to call them) is a good thing - however ideally they should *still* not rely
> on external resources. Really your test infrastructure should setup the
> server your tests connect to locally.
>

So something like mocking SSH? So it doesn't break if it is not correctly
implemented?
The tests right this moment *are* local, but still use SSH to move the files
from one spot to the other (e.g. 'ssh foo at localhost')


> If these tests have dependencies then you should document these.
>

Always!

>
> My 0.02c.
>

I was going to ask how much I owed you...

>
> Michael Foord
>
>
>  Thanks!
>
> --
> Alfredo Deza
>
>
> _______________________________________________
> testing-in-python mailing listtesting-in-python at lists.idyll.orghttp://lists.idyll.org/listinfo/testing-in-python
>
>
>
> -- http://www.ironpythoninaction.com/http://www.voidspace.org.uk/blog
>
> READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer.
>
>
>


-- 
Alfredo Deza
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20100406/3c61b089/attachment.htm>


More information about the testing-in-python mailing list