Package jptests
source code
Unit tests for the Jazz Parser.
This package contains all unit tests for the Jazz Parser. A library of
unit tests should be gradually built up in here and should mirror the
package structure of the codebase in the jazzparser package, to keep it
clear where tests for everything are to be found.
At the time of writing, not many tests exist and will almost certainly
never get round to writing tests for large parts of the codebase.
However, there are some parts that are used particularly frequently, so I
will try to write tests for these first (data structures, utils modules,
etc). These are also expected to maintain their interface, or at least
something backward compatible, most of the time, so it shouldn't be too
big a job to rewrite the tests if they change.
For scripts for running the tests, see bin/tests.
Notes
-
I've not used the test_*.py naming convention, since the tests are
all in a separate code tree, so there's no real need. The scripts
for running the tests take care of all these sorts of things, so
it's best to use them to run tests.
-
Some tests are for things in a module's __init__.py. Although I'm
in most cases mirroring the package structure of the code in the
test code, in these cases I call the test files init.py. If they're
called __init__.py they get discovered twice by unittest: once as
the package import and once as the __init__.py file itself.
Author:
Mark Granroth-Wilding <mark.granroth-wilding@ed.ac.uk>
|
|
__package__ = None
hash(x)
|
|
Loads a sequence index file, pulls out some data and prepares it as it
using it as input to the parser.
This may be used by tests to get hold of data as example input.
- Returns: tuple
- (sequence index, sequence, DbInput instance)
Note:
Don't rely on the size of the returned tuple to stay the same. I
may add more return items in the future, so access the ones that
are being returned currently by index.
|