Skip to content
sampsyo edited this page Mar 10, 2013 · 12 revisions

Running the Tests

If you have nose, just run nosetests in the beets repository. Otherwise, cd test and then ./testall.py.

Needs testing

  • library options
  • browsing functions (artists, albums, items) AND their naive implementations
  • MusicBrainz -- need to mock the web service. This version has some tests that should be reinstated once the WS is mocked out.
  • UI code -- this breaks all the time. Need a good way to mock the filesystem.

Refinements

It would be nice to get rid of the rsrc directory with all the sample files in it and instead just include the relevant metadata somewhere. A nice mock filesystem would also be convenient.

It would be awesome to enable parallel test execution in nose.

There's a tool called cram that looks useful for acceptance testing of CLI interactions.

Red Flags

coverage run --source=beets testall.py (We're at about 60% coverage right now -- not too good! There are some pretty obvious things to cover, too.)

python -3 testall.py (Raises a few warnings, and a lot of warnings for Mutagen. Right now, the warnings are: buffer has been replaced with memoryview in py3k, and we use some integer division. Python 2.6 supports b'' literals, but Python 2.5 doesn't.

Use unicode-nazi. This tool finds lots of places where we're sloppy about Unicode strings. Try running python -m unicodenazi beet version or putting import unicodenazi at the top of testall.py.

Clone this wiki locally