Fix py26 compatibility issue, add mock to tox

The test suite is still broken for py26 because of unittest.skipUnless, but I don't think that's related to your branch.  Otherwise, this looks fine to me.  I'd rather see a controlled exception than a KeyError.