[Biopython-dev] "Online" tests, was [Bug 1972]

Bill Barnard bill at barnard-engineering.com
Wed Mar 22 16:38:34 UTC 2006


On Tue, 2006-03-21 at 12:17 +0000, Peter (BioPython-dev) wrote:
> bugzilla-daemon at portal.open-bio.org wrote:
> > http://bugzilla.open-bio.org/show_bug.cgi?id=1972
> > 
> > ------- Comment #2 from bill at barnard-engineering.com  2006-03-21 03:25 -------
> > I thought of this after I submitted the patch. Even though the existing test
> > simply compares the output to the stored output of a previous test, this bug
> > could be added as a test case such that if an unsupported change occurs to the
> > Prosite format, an exception will be raised when running the test.
> > 
> > Add the lines to Tests/test_prosite2.py:
> > 
> > expasy_dict = Prosite.ExPASyDictionary(parser=record_parser)
> > entry = expasy_dict['PS00079']
> > print entry.accession
> > 
> > or some such, then regenerate the test output file.
> 
> This change would add a test requiring internet access, right?

That is correct. The test I suggest belongs elsewhere than in
test_prosite2; see below...

> 
> I think BioPython has previously avoiding doing this...

Tests.test_Registry checks on-line retrieval from several remote DBs.

Further investigation shows this:

[billb at tioga Tests]$ grep -l requires_internet *.py
requires_internet.py
test_ais.py
test_EUtils.py
test_HotRand.py
test_Registry.py

> 
> Perhaps we should have some additional "online tests" for some modules - 
> but handled separately so that people can test most of BioPython WITHOUT 
> having a network connection (e.g. due to using a standalone machine, 
> proxy complications, dialup etc).

Perhaps another test case similar to test_Registry should be implemented
with the purpose of detecting DB format changes. I'll be happy to have a
go at it, should you want such a test.

test_Registry appears to check basic connectivity, and that the record
retrieved matches the one requested, but does no parsing other than to
look at the first N bytes from the data returned to see if it contains
the requested ID.

> 
> I had wondered about this as a general point for the BioPython test 
> framework (as there are lots of other modules that can fetch information 
> or query online tools - e.g. online blast).

Any test that needs a remote resource should import requires_internet
and then can fail gracefully if the internet is not accessible.

This does not address the bandwidth issue for those on dial-up, however
the tests so far don't appear to retrieve very much data. A parser test
could retrieve small records to minimize bandwidth and memory.

As to proxies; I didn't look too hard but probably most, if not all, the
remote resources will be accessed through http which should be no
problem. If http is not accessible, require_internet handles that case.

Bill




More information about the Biopython-dev mailing list