LamsonProject: Lamson 0.9.2, Test Coverage 97%

#

# Lamson 0.9.2, Test Coverage 97%

The 0.9.2 release is out and ready for everyone to easy_install. I spent the day getting rid of my tech debt by boosting the Lamson test coverage to a whopping 97%.

I also wrote new documentation on Running A Queue Receiver in a separate process using Lamson.

## Test Coverage 97%

I used the very awesome mock library which let me mock out a bunch of the system calls that the lamson.commands module accesses to do its work.

    Name                    Stmts   Exec  Cover   Missing
    -----------------------------------------------------
    lamson                      0      0   100%
    lamson.args               120    120   100%
    lamson.commands           185    178    96%   199-200, 347-349, 367, 369
    lamson.handlers             0      0   100%
    lamson.handlers.log         4      4   100%
    lamson.handlers.queue       6      6   100%
    lamson.mail               122    121    99%   234
    lamson.queue               30     30   100%
    lamson.routing            185    184    99%   417
    lamson.server              85     84    98%   182
    lamson.spam                80     74    92%   38-40, 59, 65-66
    lamson.utils               53     50    94%   57, 70-71
    lamson.view                15     15   100%
    -----------------------------------------------------
    TOTAL                     885    866    97%
    ----------------------------------------------------------------------
    Ran 84 tests in 7.056s

By mocking out things like `sys.exit` and sockets I’m able to run the code and make sure those methods were called correctly. I could also throw exceptions to make sure that exception handlers ran correctly.

## Two Bugs Fixed

Interestingly enough, increasing the test coverage to 97% didn’t find any more bugs. I did find one small bug and one obvious bug in the 0.9.1 release.

1. If you gave a trailing option that wasn’t a string it would throw an exception.
2. If you tried to start with a different boot script then it wouldn’t do it.

These are now fixed in the 0.9.2 release, so make sure you grab it with the easiest method being:

    $ sudo easy_install lamson

## IRC Channel on irc.freenode.org

I’m now hanging out in the #lamson channel on irc.freenode.org. Anyone who wants to come and chat about lamson can stop by. I should be there all the time, but I may not respond immediately.